Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWade Berrier <wade@mono-cvs.ximian.com>2007-03-08 01:14:19 +0300
committerWade Berrier <wade@mono-cvs.ximian.com>2007-03-08 01:14:19 +0300
commita158155808d5dd2eb1a902496728dfd2dc2456aa (patch)
treef808bbdb220cc0202af984e605ee927583311dc9 /Extras/AspNetEdit/AspNetEdit.Editor.ComponentModel/NameCreationService.cs
parentaca6a41a900f040c062c675ecea5af04fe063a0d (diff)
Merged the following revisions from trunk:
asp.net editor fixes: 73390 73398 73403 73405 Other fixes: 73393 73394 73395 svn path=/branches/monodevelop/0.13/; revision=73916
Diffstat (limited to 'Extras/AspNetEdit/AspNetEdit.Editor.ComponentModel/NameCreationService.cs')
-rw-r--r--Extras/AspNetEdit/AspNetEdit.Editor.ComponentModel/NameCreationService.cs16
1 files changed, 6 insertions, 10 deletions
diff --git a/Extras/AspNetEdit/AspNetEdit.Editor.ComponentModel/NameCreationService.cs b/Extras/AspNetEdit/AspNetEdit.Editor.ComponentModel/NameCreationService.cs
index 818dae819d..7a5bdf34aa 100644
--- a/Extras/AspNetEdit/AspNetEdit.Editor.ComponentModel/NameCreationService.cs
+++ b/Extras/AspNetEdit/AspNetEdit.Editor.ComponentModel/NameCreationService.cs
@@ -48,16 +48,12 @@ namespace AspNetEdit.Editor.ComponentModel
//check existing components with name of same form
// and make suffixNumber bigger than the greatest of them
foreach (IComponent comp in container.Components) {
- if (comp.Site.Name.StartsWith (dataType.Name)) {
- string str = comp.Site.Name.Remove (0, dataType.Name.Length);
- //TODO: Use int.TryParse in .NET 2.0
- try {
- int val = int.Parse (str);
- if (val >= suffixNumber)
- suffixNumber = val + 1;
- }
- catch (Exception ex) {}
- }
+ if (comp.Site.Name.ToLowerInvariant().StartsWith (dataType.Name.ToLowerInvariant())) {
+ string str = comp.Site.Name.Substring(dataType.Name.Length);
+ int val;
+ if (int.TryParse(str, out val) && val >= suffixNumber)
+ suffixNumber = val + 1;
+ }
}
return dataType.Name + suffixNumber.ToString ();