Castle.ManagementExtensions.ManagedObjectName.SetupProperties C# (CSharp) Method

SetupProperties() protected method

Validates a properties Hashtable.
protected SetupProperties ( Hashtable properties ) : void
properties System.Collections.Hashtable Property list.
return void
		protected virtual void SetupProperties(Hashtable properties)
		{
			StringBuilder sb = new StringBuilder();

			foreach(DictionaryEntry entry in properties)
			{
				if (sb.Length != 0)
				{
					sb.Append(",");
				}

				String key = null;

				try
				{
					key = (String) entry.Key;
				}
				catch(InvalidCastException)
				{
					throw new InvalidManagedObjectName("Key is not a String.");
				}

				String value = null;

				try
				{
					value = (String) entry.Value;
				}
				catch(InvalidCastException)
				{
					throw new InvalidManagedObjectName("Value is not a String.");
				}

				sb.AppendFormat("{0}={1}", key, value);
			}

			this.literalProperties = sb.ToString();
			this.properties = new Hashtable(properties);
		}

Same methods

ManagedObjectName::SetupProperties ( String properties ) : void