Exemplo n.º 1
0
        /// <summary>
        /// Retrieves the underlying data value.
        /// </summary>
        /// <returns></returns>
        private ICCNetObject RetrieveDataValue()
        {
            ICCNetObject data     = null;
            Type         dataType = parent.GetType();
            PropertyInfo property = dataType.GetProperty(source.Property);

            if (property != null)
            {
                data = property.GetValue(parent, new object[0]) as ICCNetObject;
            }
            if (data == null)
            {
                data = Activator.CreateInstance(source.ItemType) as ICCNetObject;
            }
            return(data);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Generates the child nodes based on the attributes.
 /// </summary>
 /// <param name="parent">The node to add the children to.</param>
 /// <param name="source">The object to retrieve the settings from.</param>
 public static void GenerateChildNodes(TreeNode parent, ICCNetObject source)
 {
     if (source != null)
     {
         Type sourceType = source.GetType();
         GenerateListNodes(parent, source, sourceType);
         GenerateInstanceNodes(parent, source, sourceType);
     }
     UpdateImages(parent);
 }
        /// <summary>
        /// Retrieves the underlying data list.
        /// </summary>
        /// <returns></returns>
        private IList RetrieveDataList()
        {
            IList        data     = null;
            Type         dataType = dataItem.GetType();
            PropertyInfo property = dataType.GetProperty(source.Property);

            if (property != null)
            {
                data = property.GetValue(dataItem, new object[0]) as IList;
            }
            return(data);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RequiredAttributeException"/> class.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <param name="name">The name.</param>
 public RequiredAttributeException(ICCNetObject owner, string name)
     : base(string.Format("Value of {0} in {1} can not be null or Empty", name, string.IsNullOrEmpty(owner.ToString()) ? owner.GetType().Name : owner.ToString()))
 {
 }