From 8b7b150da7a4f288c5112a116e9e26815fd8621a Mon Sep 17 00:00:00 2001 From: ptsurbeleu Date: Fri, 10 Feb 2012 00:01:39 -0800 Subject: [PATCH] Fixed some perf concerns related to types conversion; Replaced tabs with spaces; --- .../WebsitePanel/Code/Framework/Utils.cs | 127 ++++++++++++------ 1 file changed, 84 insertions(+), 43 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs index 2270d1b1..17abd1ae 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs @@ -47,7 +47,7 @@ namespace WebsitePanel.Portal /// - /// Builds list of items from supplied group string. - /// - /// Group string. - /// List of items. - public static List> ParseGroup(string group) - { - List> items = new List>(); - string[] vals = group.Split(';'); - foreach (string v in vals) - { - string itemValue = v; - string itemText = v; + /// + /// Builds list of items from supplied group string. + /// + /// Group string. + /// List of items. + public static List> ParseGroup(string group) + { + List> items = new List>(); + string[] vals = group.Split(';'); + foreach (string v in vals) + { + string itemValue = v; + string itemText = v; - int eqIdx = v.IndexOf("="); - if (eqIdx != -1) - { - itemValue = v.Substring(0, eqIdx); - itemText = v.Substring(eqIdx + 1); - } + int eqIdx = v.IndexOf("="); + if (eqIdx != -1) + { + itemValue = v.Substring(0, eqIdx); + itemText = v.Substring(eqIdx + 1); + } - items.Add(new KeyValuePair(itemText, itemValue)); - } - return items; - } + items.Add(new KeyValuePair(itemText, itemValue)); + } + return items; + } public static void SelectListItem(ListControl ctrl, object value) @@ -215,13 +256,13 @@ namespace WebsitePanel.Portal } } - public static string EllipsisString(string str, int maxLen) - { - if (String.IsNullOrEmpty(str) || str.Length <= maxLen) - return str; + public static string EllipsisString(string str, int maxLen) + { + if (String.IsNullOrEmpty(str) || str.Length <= maxLen) + return str; - return str.Substring(0, maxLen) + "..."; - } + return str.Substring(0, maxLen) + "..."; + } public static string GetRandomString(int length) {