Exemplo n.º 1
0
        /// <summary>
        /// Creates and adds new VirtualObjectType to registry
        /// </summary>
        /// <param name="a_Name">
        /// Name of new virtual object <see cref="System.String"/>
        /// </param>
        /// <remarks>
        /// When it is used this way it has to be resolved after to get the object for this type
        /// </remarks>
        public static void Add(string a_Name)
        {
            VirtualObjectType obj = new VirtualObjectType(a_Name);

            Add(obj);
            obj = null;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Removes VirtualObjectType from registry
        /// </summary>
        /// <param name="a_Name">
        /// Object type name <see cref="System.String"/>
        /// </param>
        public static void Remove(string a_Name)
        {
            VirtualObjectType obj = ObjectByName(a_Name);

            Remove(obj);
            obj = null;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Unlocks the object type
 /// </summary>
 /// <param name="a_Object">
 /// Object type <see cref="VirtualObjectType"/>
 /// </param>
 public static void Unlock(VirtualObjectType a_Object)
 {
     if (a_Object == null)
     {
         throw new ExceptionUnlockNullVirtualObject();
     }
     a_Object.Unlock();
 }
Exemplo n.º 4
0
        /// <summary>
        /// Removes VirtualObjectType from registry
        /// </summary>
        /// <param name="a_Object">
        /// Object type to remove <see cref="VirtualObjectType"/>
        /// </param>
        public static void Remove(VirtualObjectType a_Object)
        {
            if (a_Object == null)
            {
                return;
            }
//			if (ObjectByName(a_Object.Name) != null)
//				throw new Exception ("Duplicate object registered '" + a_Object.Name + "'");
            objects.Remove(a_Object);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Unlocks the object type
        /// </summary>
        /// <param name="a_Name">
        /// Object type name <see cref="System.String"/>
        /// </param>
        public static void Unlock(string a_Name)
        {
            VirtualObjectType obj = ObjectByName(a_Name);

            if (obj == null)
            {
                throw new ExceptionUnlockNullNonExistantVirtualObject(a_Name);
            }
            Unlock(obj);
            obj = null;
        }
 /// <summary>
 /// Inherits the properties from other type
 /// </summary>
 /// <param name="a_Type">
 /// Virtual object type <see cref="VirtualObjectType"/>
 /// </param>
 /// <returns>
 /// true <see cref="System.Boolean"/>
 /// </returns>
 /// <remarks>
 /// Throws Exception if property already exists
 ///
 /// WARNING! Modifying type doesn't updates already created objects
 /// </remarks>
 public bool InheritStrict(VirtualObjectType a_Type)
 {
     if (a_Type == null)
     {
         throw new ExceptionVirtualObjectCantInheritNullType();
     }
     for (int i = 0; i < Count; i++)
     {
         AddMember(a_Type[i].Name, a_Type[i].PropertyType);
     }
     return(true);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Adds VirtualObjectType to the registry
 /// </summary>
 /// <param name="a_Object">
 /// Object to add <see cref="VirtualObjectType"/>
 /// </param>
 /// <remarks>
 /// If object by that name already exists exception is thrown
 /// </remarks>
 public static void Add(VirtualObjectType a_Object)
 {
     if (a_Object == null)
     {
         return;
     }
     if (ObjectByName(a_Object.Name) != null)
     {
         throw new ExceptionDuplicateVirtualObjectRegistered(a_Object.Name);
     }
     objects.Add(a_Object);
 }
 /// <summary>
 /// Inherits the properties from other type
 /// </summary>
 /// <param name="a_Type">
 /// Object type <see cref="VirtualObjectType"/>
 /// </param>
 /// <returns>
 /// true <see cref="System.Boolean"/>
 /// </returns>
 /// <remarks>
 /// If property already exists, it avoids copying it
 ///
 /// WARNING! Modifying type doesn't updates already created objects
 /// </remarks>
 public bool InheritRelaxed(VirtualObjectType a_Type)
 {
     if (a_Type == null)
     {
         return(false);
     }
     for (int i = 0; i < Count; i++)
     {
         if (this[a_Type[i].Name] == null)
         {
             AddMember(a_Type[i].Name, a_Type[i].PropertyType);
         }
     }
     return(true);
 }