void IInitializable.Initialize()
        {

            string misc = "Misc".Localize();
             var userSettings = new System.ComponentModel.PropertyDescriptor[]
                {                                       
                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.BackColor, "BackgroundColor".Localize(), misc,
                        "Background color".Localize()),
                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.CameraFarZ, "FarZ".Localize(), misc,
                        "Camera Far Z".Localize()),
                                     
                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.ControlScheme, "ControlScheme".Localize(), misc,
                        "Control scheme".Localize()),
                                       
                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.SnapVertex,
                        "SnapVertex".Localize(),
                        misc,"Snap vertex".Localize()),

                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.RotateOnSnap,
                        "RotateOnSnap".Localize(),
                        misc, "Rotate on snap".Localize())                     
                };

            m_settingsService.RegisterUserSettings( "Editors".Localize() + "/" + "DesignView".Localize(), userSettings);
            m_settingsService.RegisterSettings(this, userSettings);

            if (m_scriptingService != null)
                m_scriptingService.SetVariable("designView", m_designView);
        }
示例#2
0
 // Constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="T:ColumnInfo"/> class.
 /// </summary>
 /// <param name="ordinal">The 0-based ordinal of the column.</param>
 /// <param name="name">The name of the column.</param>
 /// <param name="type">The type of the column.</param>
 /// <param name="typeName">The type name for the column.</param>
 public ColumnInfo(Int32 ordinal, String name, Type type, String typeName)
     : base()
 {
     this._ordinal = ordinal;
     this._name = name;
     this._type = type;
     this._typeName = typeName;
     this._propertyDescriptor = new DataRecordPropertyDescriptor(ordinal, name, type);
 }
示例#3
0
 /// <summary>
 /// Constructor</summary>
 /// <param name="masterDescriptor">Master descriptor to serve as template.
 /// Name, PropertyType, Category, Description, ReadOnly, Editor, Converter 
 /// and Attributes of this descriptor are all used.</param>
 public MultiPropertyDescriptor(SysPropertyDescriptor masterDescriptor)
     : base(
         masterDescriptor.Name,
         masterDescriptor.PropertyType,
         masterDescriptor.Category,
         masterDescriptor.Description,
         masterDescriptor.IsReadOnly,
         masterDescriptor.GetEditor(typeof(object)),
         masterDescriptor.Converter,
         masterDescriptor.Attributes.Cast<Attribute>().ToArray())
 {
     m_key = masterDescriptor.GetPropertyDescriptorKey();
 }
        void IInitializable.Initialize()
        {
            
            var snapAngleEditor = new NumericEditor(typeof(float));
            snapAngleEditor.ScaleFactor = 180.0 / Math.PI;
            string misc = "Misc".Localize();
            var userSettings = new System.ComponentModel.PropertyDescriptor[]
                {                                       
                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.BackColor, "BackgroundColor".Localize(), misc,
                        "Background color".Localize()),
                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.CameraFarZ, "FarZ".Localize(), misc,
                        "Camera Far Z".Localize()),
                                     
                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.ControlScheme, "ControlScheme".Localize(), misc,
                        "Control scheme".Localize()),
                                       
                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.SnapVertex,
                        "SnapVertex".Localize(),
                        misc,"Snap vertex".Localize()),

                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.RotateOnSnap,
                        "RotateOnSnap".Localize(),
                        misc, "Rotate on snap".Localize()),

                    new BoundPropertyDescriptor(
                        m_designView, () => m_designView.SnapAngle,
                        "Snap Angle".Localize(),
                        misc, "Snap to angle when using rotation manipulator." +
                              "Angle is in degrees. Set it to zero to disable snapping.".Localize(), snapAngleEditor,null)
                     
                };

            m_settingsService.RegisterUserSettings( "Editors".Localize() + "/" + "DesignView".Localize(), userSettings);
            m_settingsService.RegisterSettings(this, userSettings);

            var snapfrom = new BoundPropertyDescriptor(
                         m_designView, () => m_designView.SnapFrom,
                         "SnapMode".Localize(),null, null);
            m_settingsService.RegisterSettings(this, snapfrom);

            if (m_scriptingService != null)
                m_scriptingService.SetVariable("designView", m_designView);
        }
示例#5
0
        protected override object GetPropertyValue(ControllerContext controllerContext, ModelBindingContext bindingContext, System.ComponentModel.PropertyDescriptor propertyDescriptor, IModelBinder propertyBinder)
        {
            object value = propertyBinder.BindModel(controllerContext, bindingContext);

            return(value);
        }
 public ListChangedEventArgs(System.ComponentModel.ListChangedType listChangedType, System.ComponentModel.PropertyDescriptor propDesc)
 {
     this.listChangedType = listChangedType;
     this.propDesc = propDesc;
 }
示例#7
0
 public ThemeComparer(System.ComponentModel.PropertyDescriptor initProp, System.ComponentModel.ListSortDirection initDirection)
     : base()
 {
     _sortProperty  = initProp;
     _sortDirection = initDirection;
 }
示例#8
0
        /// <summary>
        /// Store the UI data within the current record or row control and return as hashtable
        /// </summary>
        /// <returns></returns>
        /// <remarks></remarks>
        public virtual Hashtable PreservedUIData()
        {
            // This method get the UI data within the current record and return them as Hastable
            Hashtable uiData = new Hashtable();


            Control[] controls = MiscUtils.FindControlsRecursively(this as BaseApplicationRecordControl);

            foreach (Control control in controls)
            {
                if (!string.IsNullOrEmpty(control.ID) && !uiData.ContainsKey(control.ID))
                {
                    if (object.ReferenceEquals(control.GetType(), typeof(TextBox)))
                    {
                        TextBox textbox = (TextBox)control;
                        uiData.Add(textbox.ID, textbox.Text);
                    }
                    else if (object.ReferenceEquals(control.GetType(), typeof(Literal)))
                    {
                        Literal literal = (Literal)control;
                        uiData.Add(literal.ID, literal.Text);
                    }
                    else if (object.ReferenceEquals(control.GetType(), typeof(Label)))
                    {
                        Label label = (Label)control;
                        uiData.Add(label.ID, label.Text);
                    }
                    else if (object.ReferenceEquals(control.GetType(), typeof(CheckBox)))
                    {
                        CheckBox checkbox = (CheckBox)control;
                        uiData.Add(checkbox.ID, checkbox.Checked);
                    }
                    else if (object.ReferenceEquals(control.GetType(), typeof(Button)))
                    {
                        Button button = (Button)control;
                        uiData.Add(button.ID, button.Text);
                    }
                    else if (object.ReferenceEquals(control.GetType(), typeof(LinkButton)))
                    {
                        LinkButton linkButton = (LinkButton)control;
                        uiData.Add(linkButton.ID, linkButton.Text);
                    }
                    else if (object.ReferenceEquals(control.GetType(), typeof(ListBox)))
                    {
                        ListBox listbox = (ListBox)control;
                        uiData.Add(listbox.ID, MiscUtils.GetValueSelectedPageRequest(listbox));
                    }
                    else if (object.ReferenceEquals(control.GetType(), typeof(DropDownList)))
                    {
                        DropDownList dropdownList = (DropDownList)control;
                        uiData.Add(dropdownList.ID, MiscUtils.GetValueSelectedPageRequest(dropdownList));
                    }
                    else if (object.ReferenceEquals(control.GetType(), typeof(DropDownList)))
                    {
                        RadioButtonList radioButtonList = (RadioButtonList)control;
                        uiData.Add(radioButtonList.ID, MiscUtils.GetValueSelectedPageRequest(radioButtonList));
                    }
                    else if (control.GetType().GetInterface("IDatePagination") != null || control.GetType().GetInterface("IDatePaginationMobile") != null)
                    {
                        // Save the pagination's Interval and FirstStartDate and restore it by these values later
                        System.Reflection.PropertyInfo[] props = control.GetType().GetProperties();
                        Hashtable ht = new Hashtable();
                        foreach (System.Reflection.PropertyInfo prop in props)
                        {
                            System.ComponentModel.PropertyDescriptor descriptor = System.ComponentModel.TypeDescriptor.GetProperties(control.GetType())[prop.Name];
                            if (descriptor.Name == "Interval")
                            {
                                ht.Add("Interval", prop.GetValue(control, null).ToString());
                            }
                            else if (descriptor.Name == "FirstStartDate")
                            {
                                ht.Add("FirstStartDate", prop.GetValue(control, null).ToString());
                            }
                        }
                        uiData.Add(control.ID, ht);
                    }
                }
            }
            return(uiData);
        }
 protected virtual new Object GetValue(System.Web.UI.Control controlContainer, string fieldName, ref System.ComponentModel.PropertyDescriptor cachedDescriptor)
 {
     return(default(Object));
 }
示例#10
0
        protected override object GetPropertyValue(ControllerContext controllerContext, ModelBindingContext bindingContext, System.ComponentModel.PropertyDescriptor propertyDescriptor,
                                                   IModelBinder propertyBinder)
        {
            var propertyType = propertyDescriptor.PropertyType;

            if ((typeof(IEnumerable <string>).IsAssignableFrom(propertyType)))
            {
                var providerValue = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
                if (null != providerValue)
                {
                    var value = (IEnumerable <string>)providerValue.RawValue;
                    if (value.Contains("~"))
                    {
                        // this will remove all the extra properties
                        return(new List <string> {
                            "~"
                        });
                    }
                }
            }

            return(base.GetPropertyValue(controllerContext, bindingContext, propertyDescriptor, propertyBinder));
        }
示例#11
0
 public TList_Cad_TaxaBandeiraCartao(System.ComponentModel.PropertyDescriptor Prop,
                                     System.Windows.Forms.SortOrder Dir)
 {
     Propriedade = Prop;
     Direcao     = Dir;
 }
示例#12
0
 public TList_LanPecasEnvTerceiro(System.ComponentModel.PropertyDescriptor Prop,
                                  System.Windows.Forms.SortOrder Dir)
 {
     Propriedade = Prop;
     Direcao     = Dir;
 }
 Object System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner(System.ComponentModel.PropertyDescriptor pd)
 {
     return(default(Object));
 }
 public virtual object GetItemValue(int index, System.ComponentModel.PropertyDescriptor property)
 {
     return(property.GetValue(mDataView[index]));
 }
示例#15
0
 public TList_ValorCaracteristica(System.ComponentModel.PropertyDescriptor Prop,
                                  System.Windows.Forms.SortOrder Dir)
 {
     Propriedade = Prop;
     Direcao     = Dir;
 }
 void System.ComponentModel.IBindingList.AddIndex(System.ComponentModel.PropertyDescriptor property)
 {
     this._blm2961840684.AddIndex(property);
 }
示例#17
0
        private bool CanResetValue(IEnumerable<object> items, PropertyDescriptor descriptor)
        {
            if (descriptor != null && !descriptor.IsReadOnly)
            {
                foreach (object item in items)
                    if (descriptor.CanResetValue(item))
                        return true;
            }

            return false;
        }
 void System.ComponentModel.IBindingList.AddIndex(System.ComponentModel.PropertyDescriptor property)
 {
     this._blm1655277903.AddIndex(property);
 }
 public ListSortDescription(System.ComponentModel.PropertyDescriptor property, ListSortDirection direction)
 {
     this.property = property;
     this.sortDirection = direction;
 }
示例#20
0
 public ListChangedEventArgs(System.ComponentModel.ListChangedType listChangedType, System.ComponentModel.PropertyDescriptor propDesc)
 {
     this.listChangedType = listChangedType;
     this.propDesc        = propDesc;
 }
 protected override void SetProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, System.ComponentModel.PropertyDescriptor propertyDescriptor, object value)
 {
     base.SetProperty(controllerContext, bindingContext, propertyDescriptor, value);
     PropertyWasSet = true;
 }
示例#22
0
 public ListChangedEventArgs(System.ComponentModel.ListChangedType listChangedType, int newIndex, System.ComponentModel.PropertyDescriptor propDesc) : this(listChangedType, newIndex)
 {
     this.propDesc = propDesc;
     this.oldIndex = newIndex;
 }
示例#23
0
 public TList_CTB_CFGFinanceiro(System.ComponentModel.PropertyDescriptor Prop,
                                System.Windows.Forms.SortOrder Dir)
 {
     Propriedade = Prop;
     Direcao     = Dir;
 }
示例#24
0
 void System.ComponentModel.IBindingList.RemoveIndex(System.ComponentModel.PropertyDescriptor property)
 {
     this._blm2244011348.RemoveIndex(property);
 }
示例#25
0
 public TList_CadEncargosFolha(System.ComponentModel.PropertyDescriptor Prop,
                               System.Windows.Forms.SortOrder Dir)
 {
     Propriedade = Prop;
     Direcao     = Dir;
 }
示例#26
0
        protected override void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, System.ComponentModel.PropertyDescriptor propertyDescriptor)
        {
            if (!Attribute.IsDefined(bindingContext.ModelType, typeof(DryLogicObjectAttribute)) || propertyDescriptor.PropertyType == typeof(ObjectInstance))
            {
                base.BindProperty(controllerContext, bindingContext, propertyDescriptor);
            }
            else
            {
                var oi = ObjectInstance.GetObjectInstance(bindingContext.Model);
                //base.BindProperty(controllerContext, bindingContext, propertyDescriptor);

                var    request = controllerContext.HttpContext.Request;
                string prefix  = bindingContext.ModelName;
                if (!String.IsNullOrEmpty(prefix))
                {
                    prefix += ".";
                }

                //make sure this is actually a property that can be set (don't want to provide a back door to overposting)
                var prop = bindingContext.ModelType.GetProperty(propertyDescriptor.DisplayName, BindingFlags.Public | BindingFlags.Instance);
                if (prop == null || prop.CanWrite == false)
                {
                    throw new InvalidOperationException($"Property '{propertyDescriptor.DisplayName}' cannot be written to.");
                }

                if (oi.PropertyValues[propertyDescriptor.DisplayName].ValueType == typeof(Boolean))
                {
                    //mvc rendered checkboxes with an extra hidden tag so that an unchecked input still returns a value.
                    //  unfortunately this also means that a checked value returns the value of both so it comes back as "true,false"
                    oi.PropertyValues[propertyDescriptor.DisplayName].Value = !(request.Form[prefix + propertyDescriptor.DisplayName] == "false");
                }
                else
                {
                    oi.PropertyValues[propertyDescriptor.DisplayName].StringValue = request.Form[prefix + propertyDescriptor.DisplayName];
                }
            }
        }
示例#27
0
 public TList_PosVendaQuestionario(System.ComponentModel.PropertyDescriptor Prop,
                                   System.Windows.Forms.SortOrder Dir)
 {
     Propriedade = Prop;
     Direcao     = Dir;
 }
示例#28
0
 void System.ComponentModel.IBindingList.ApplySort(System.ComponentModel.PropertyDescriptor property, System.ComponentModel.ListSortDirection direction)
 {
     this._blm1274680529.ApplySort(property, direction);
 }
    protected override object GetPropertyValue(ControllerContext controllerContext, ModelBindingContext bindingContext, System.ComponentModel.PropertyDescriptor propertyDescriptor, IModelBinder propertyBinder)
    {
        if (propertyDescriptor.PropertyType.GetInterface(typeof(IEnumerable).Name) != null)
        {
            var actualValue = bindingContext.ValueProvider.GetValue(propertyDescriptor.Name);

            if (actualValue != null && !String.IsNullOrWhiteSpace(actualValue.AttemptedValue) && actualValue.AttemptedValue.Contains(","))
            {
                var valueType = propertyDescriptor.PropertyType.GetElementType() ?? propertyDescriptor.PropertyType.GetGenericArguments().FirstOrDefault();

                if (valueType != null && valueType.GetInterface(typeof(IConvertible).Name) != null)
                {
                    var list = (IList)Activator.CreateInstance(typeof(List <>).MakeGenericType(valueType));

                    foreach (var splitValue in actualValue.AttemptedValue.Split(new[] { ',' }))
                    {
                        list.Add(Convert.ChangeType(splitValue, valueType));
                    }

                    if (propertyDescriptor.PropertyType.IsArray)
                    {
                        return(ToArrayMethod.MakeGenericMethod(valueType).Invoke(this, new[] { list }));
                    }
                    else
                    {
                        return(list);
                    }
                }
            }
        }

        return(base.GetPropertyValue(controllerContext, bindingContext, propertyDescriptor, propertyBinder));
    }
示例#30
0
        /// <summary>
        /// Tests if the value can be reset for the specified component</summary>
        /// <param name="component">Component for which the value is to be reset</param>
        /// <returns>True iff the value can be reset for the specified component</returns>
        public override bool CanResetValue(object component)
        {
            SysPropertyDescriptor descriptor = FindDescriptor(component);

            return(descriptor != null && descriptor.CanResetValue(component));
        }
 public ListChangedEventArgs(System.ComponentModel.ListChangedType listChangedType, int newIndex, System.ComponentModel.PropertyDescriptor propDesc) : this(listChangedType, newIndex)
 {
     this.propDesc = propDesc;
     this.oldIndex = newIndex;
 }
示例#32
0
 public object GetPropertyOwner(PropertyDescriptor pd)
 {
     return(null);
 }
示例#33
0
 int System.ComponentModel.IBindingList.Find(System.ComponentModel.PropertyDescriptor property, object key)
 {
     return(this._blm1274680529.Find(property, key));
 }
示例#34
0
        private bool CanPaste(object srcValue, 
            PropertyDescriptor srcDescriptor, 
            PropertyDescriptor destDescriptor, 
            object destValue)
        {            
            if (srcDescriptor == null
                || destDescriptor == null               
                || destDescriptor.IsReadOnly
                || srcDescriptor.PropertyType != destDescriptor.PropertyType
                || (destDescriptor is ChildAttributeCollectionPropertyDescriptor)
                || (destDescriptor is ChildPropertyDescriptor)) return false;

            if (destDescriptor.PropertyType.IsArray && destValue != null && srcValue != null)
            {
                Array srcArray = (Array)srcValue;
                Array destArray = (Array)destValue;

                if (srcArray.Rank != destArray.Rank) return false;
                for (int r = 0; r < srcArray.Rank; ++r)
                {
                    if (srcArray.GetLowerBound(r) != destArray.GetLowerBound(r) ||
                        srcArray.GetUpperBound(r) != destArray.GetUpperBound(r))
                    {
                        return false;
                    }
                }
            }

            
            return true;
        }
示例#35
0
 public TList_Devolucao(System.ComponentModel.PropertyDescriptor Prop,
                        System.Windows.Forms.SortOrder Dir)
 {
     Propriedade = Prop;
     Direcao     = Dir;
 }
示例#36
0
 void System.ComponentModel.IBindingList.RemoveIndex(System.ComponentModel.PropertyDescriptor property)
 {
     this._blm1274680529.RemoveIndex(property);
 }
示例#37
0
        //protected override object CreateModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Type modelType)
        //{
        //    Type type = modelType;
        //    if (modelType.IsGenericType)
        //    {
        //        Type genericTypeDefinition = modelType.GetGenericTypeDefinition();
        //        if (genericTypeDefinition == typeof(IDictionary<,>))
        //        {
        //            type = typeof(Dictionary<,>).MakeGenericType(modelType.GetGenericArguments());
        //        }
        //        else if (((genericTypeDefinition == typeof(IEnumerable<>)) || (genericTypeDefinition == typeof(ICollection<>))) || (genericTypeDefinition == typeof(IList<>)))
        //        {
        //            type = typeof(List<>).MakeGenericType(modelType.GetGenericArguments());
        //        }
        //        return Activator.CreateInstance(type);
        //    }
        //    else if (modelType.IsAbstract)
        //    {
        //        string concreteTypeName = bindingContext.ModelName + ".Type";
        //        var concreteTypeResult = bindingContext.ValueProvider.GetValue(concreteTypeName);

        //        if (concreteTypeResult == null)
        //            throw new Exception("Concrete type for abstract class not specified");

        //        type = Assembly.GetExecutingAssembly().GetTypes().SingleOrDefault(t => t.IsSubclassOf(modelType) && t.Name == concreteTypeResult.AttemptedValue);

        //        if (type == null)
        //            throw new Exception(String.Format("Concrete model type {0} not found", concreteTypeResult.AttemptedValue));

        //        var instance = Activator.CreateInstance(type);
        //        bindingContext.ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(() => instance, type);
        //        return instance;
        //    }
        //    else
        //    {
        //        return Activator.CreateInstance(modelType);
        //    }
        //}

        //public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        //{
        //    var dictionaryBindingContext = new ModelBindingContext()
        //    {
        //        ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(() => null, typeof(IDictionary<object,object>)),
        //        ModelName = "FileName,Description,Owner,CreationDate,checkLock", //The name(s) of the form elements you want going into the dictionary
        //        ModelState = bindingContext.ModelState,
        //        PropertyFilter = bindingContext.PropertyFilter,
        //        ValueProvider = bindingContext.ValueProvider
        //    };

        //    var model = base.BindModel(controllerContext, dictionaryBindingContext);
        //    //var model = base.BindModel(controllerContext, bindingContext);

        //    return model;
        //}

        //public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        //{

        //    var model = base.BindModel(controllerContext, bindingContext) as Files; //Bind most of the model using the built-in binder, this will bind all primitives for us
        //    model.files.
        //    const string magicString = "files";  //TODO Use of magic strings

        //    var files = bindingContext.ValueProvider.GetValue(magicString); //Get the posted value for files

        //    if (files != null && !string.IsNullOrEmpty(files.AttemptedValue))
        //    { //Check we have a value for files before we proceed

        //        bindingContext.ModelState.Remove(magicString); //Remove binding conversion errors for files, as we are going to deal with binding files ourselves

        //        try
        //        {
        //            //Create a list of files based on the comma delimited string of posted OfficeId's
        //            model.files = new List(
        //                                                files.AttemptedValue.Split(",".ToCharArray())
        //                                                .Select(id => new FileModel() { })
        //                                                .ToList()
        //                                            );
        //        }
        //        catch (FormatException ex)
        //        { //Catch if the posted files are not posted as a comma delimited string of Guids
        //            bindingContext.ModelState.AddModelError(magicString, ex); //Add an error to the model state, used for ModelState.IsValid and Html error helpers
        //        }
        //        catch (Exception ex)
        //        { //Unexpected exception
        //            throw ex;
        //        }
        //    }

        //    return model;
        //}

        protected override void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, System.ComponentModel.PropertyDescriptor propertyDescriptor)
        {
            //if (propertyDescriptor.PropertyType == typeof(List<FileModel>))
            //{
            //    var fileList = new List<FileModel>();
            //    var form = controllerContext.HttpContext.Request.Form;
            //    var keys = form.Keys;
            //    foreach (var key in keys)
            //    {

            //    }
            //}

            //{
            //    var incomingData = bindingContext.ValueProvider.GetValue("Edit." + propertyDescriptor.Name + "[]");
            //    if (incomingData != null)
            //    {
            //        List<FileModel> fileModels = new List<FileModel>();
            //        fileModels = (List<FileModel>)incomingData.ConvertTo(typeof(List<FileModel>));
            //        var model = bindingContext.Model as Files;
            //        model.files = fileModels;
            //    }
            //}

            if (propertyDescriptor.Name == "Archive")
            {
                var list = new List <int>(5);
                var form = controllerContext.HttpContext.Request.Form;
                var ids  = form.AllKeys.Where(x => x.StartsWith("id"));

                foreach (var id in ids)
                {
                    int i;
                    if (int.TryParse(form.Get(id), out i))
                    {
                        list.Add(i);
                    }
                }
                SetProperty(controllerContext, bindingContext, propertyDescriptor, list);
            }
            if (propertyDescriptor.Name == "Search")
            {
                propertyDescriptor.SetValue(bindingContext.Model, controllerContext.HttpContext.Request.Form["filename"]);
            }
            base.BindProperty(controllerContext, bindingContext, propertyDescriptor);
        }
 public object GetPropertyOwner(System.ComponentModel.PropertyDescriptor pd)
 {
     return(this);
 }
示例#39
0
 public object GetPropertyOwner(PropertyDescriptor pd)
 {
     return null;
 }
示例#40
0
        protected override void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, System.ComponentModel.PropertyDescriptor propertyDescriptor)
        {
            var binder = ModelBinders.Binders[propertyDescriptor.PropertyType];

            if (binder is DomainModelBinder)
            {
                object obj = GetbyDataBaseID(bindingContext, propertyDescriptor.PropertyType, propertyDescriptor.Name + ".ID");
                SetProperty(controllerContext, bindingContext, propertyDescriptor, obj);
            }
            else
            {
                base.BindProperty(controllerContext, bindingContext, propertyDescriptor);
            }
        }