예제 #1
0
        /// <summary>
        /// Builds or finds the state information for a <see cref="FileManageable"/> type
        /// </summary>
        /// <param name="inst">Target definition</param>
        /// <returns>State data for <paramref name="inst"/></returns>
        internal static FileManageableState Add(FileManageable inst)
        {
            Type t = inst.GetType();
            FileManageableState state = null;

            lock (Pool)
                if (!Pool.TryGetValue(t, out state))
                {
                    state = new FileManageableState(t, inst);
                    Pool.Add(t, state);
                }

            return(state);
        }
예제 #2
0
        /// <summary>
        /// Processes attributes applied to one of the inheriting classes of this class
        /// </summary>
        private void ProcessAtrributes(FileManageable inst)
        {
            #region Get definition attribute
            Type     t    = inst.GetType();
            object[] attr = t.GetCustomAttributes(typeof(ClassAttribute), false);
            if (attr.Length == 0)
            {
                return;
            }

            ClassAttribute ca = attr[0] as ClassAttribute;
            attribute = ca;
            #endregion

            groupTag = TagGroups.Groups[ca.GroupIndex];
        }
예제 #3
0
		/// <summary>
		/// Builds or finds the state information for a <see cref="FileManageable"/> type
		/// </summary>
		/// <param name="inst">Target definition</param>
		/// <returns>State data for <paramref name="inst"/></returns>
		internal static FileManageableState Add(FileManageable inst)
		{
			Type t = inst.GetType();
			FileManageableState state = null;

			lock(Pool)
				if (!Pool.TryGetValue(t, out state))
				{
					state = new FileManageableState(t, inst);
					Pool.Add(t, state);
				}

			return state;
		}
예제 #4
0
		/// <summary>
		/// Processes attributes applied to one of the inheriting classes of this class
		/// </summary>
		private void ProcessAtrributes(FileManageable inst)
		{
			#region Get definition attribute
			Type t = inst.GetType();
			object[] attr = t.GetCustomAttributes(typeof(ClassAttribute), false);
			if (attr.Length == 0) return;

			ClassAttribute ca = attr[0] as ClassAttribute;
			attribute = ca;
			#endregion

			groupTag = TagGroups.Groups[ca.GroupIndex];
		}