Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conversion from C# to VB.NET
Message
From
17/04/2013 15:10:17
 
 
To
17/04/2013 14:38:37
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01571173
Message ID:
01571263
Views:
38
>On second thought, you may not need a lock at all - but don't set Tables to null. Create a tmp variable, initialize that, and assign afterwards
>Locking gives a bit of overhead
>
>	public class AClass
>	{
>		private Dictionary<string, string> Tables_;
>	
>		public Dictionary<string, string> Tables
>		{
>			get; private set; 
>
>		}
>
>		public AClass()
>		{
>			// Initialize Tables
>			Tables_ = new Dictionary<string, string>();
>			Tables_.Add("1", "one");
>			Tables_.Add("2", "two");
>		}
>		public void ReInitializeTables()
>		{
>			// do not set to null
>
>			Dictionary<string, string> tmp = new Dictionary<string, string>();
>			tmp.Add("3", "three");
>			tmp.Add("4", "four");
>
>			Tables_ = tmp;
>
>		}
>	}
>
That could work as well. I will let you know.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform