private void init(ListlikeAbstractor <T> list, String name, Func <T> createNewCallback, Action <T> removedCallback, Validate validateCallback, MemberScanner memberScanner)
        {
            this.list = list;
            this.createNewCallback = createNewCallback;
            this.removedCallback   = removedCallback;
            this.validateCallback  = validateCallback;

            //If no member scanner passed, set it to the default one
            if (memberScanner == null)
            {
                memberScanner = ReflectedEditInterface.DefaultScanner;
            }

            this.memberScanner = memberScanner;

            EditablePropertyInfo propertyInfo = new EditablePropertyInfo();

            foreach (var item in this.memberScanner.getMatchingMembers(typeof(T)))
            {
                propertyInfo.addColumn(new EditablePropertyColumn(item.getWrappedName(), false));
            }

            addPropertyCallback    = add;
            removePropertyCallback = remove;

            setPropertyInfo(propertyInfo);

            for (int i = 0; i < list.Count; ++i)
            {
                addProperty(i);
            }
        }
Exemple #2
0
        /// <summary>
        /// Build the EditInterface for the given type.
        /// </summary>
        /// <param name="name">The name to use.</param>
        /// <param name="target">The target object.</param>
        /// <param name="validateCallback">Validate callback.</param>
        /// <returns>An EditInterface for the specific object.</returns>
        private static EditInterface buildInterface(String name, Validate validateCallback)
        {
            EditInterface        createdInterface = new EditInterface(name, null, null, validateCallback);
            EditablePropertyInfo propertyInfo     = new EditablePropertyInfo();

            propertyInfo.addColumn(new EditablePropertyColumn("Name", true));
            propertyInfo.addColumn(new EditablePropertyColumn("Value", false));
            createdInterface.setPropertyInfo(propertyInfo);
            return(createdInterface);
        }
Exemple #3
0
        private void init(ListlikeAbstractor <T> list, String name, Validate validateCallback, Func <EditUICallback, Browser> getBrowser)
        {
            this.list       = list;
            this.getBrowser = getBrowser;

            EditablePropertyInfo propertyInfo = new EditablePropertyInfo();

            propertyInfo.addColumn(new EditablePropertyColumn("Value", false));

            this.addPropertyCallback    = add;
            this.removePropertyCallback = remove;
            this.validateCallback       = validateCallback;

            setPropertyInfo(propertyInfo);

            for (int i = 0; i < list.Count; ++i)
            {
                addProperty(i);
            }
        }
Exemple #4
0
 /// <summary>
 /// Set the EditablePropertyInfo.
 /// </summary>
 /// <param name="propertyInfo">The info to set.</param>
 public void setPropertyInfo(EditablePropertyInfo propertyInfo)
 {
     this.propertyInfo = propertyInfo;
 }