Esempio n. 1
0
 public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
 {
     if (VPLUtil.GetBrowseableProperties(attributes))
     {
         PropertyDescriptorCollection ps   = TypeDescriptor.GetProperties(this, attributes, true);
         List <PropertyDescriptor>    list = new List <PropertyDescriptor>();
         foreach (PropertyDescriptor p in ps)
         {
             if (string.CompareOrdinal(p.Name, "ReturnValueType") == 0)
             {
                 if (_methodPointer == null || _methodPointer.NoReturn || !_methodPointer.HasReturn)
                 {
                     continue;
                 }
             }
             list.Add(new PropertyDescriptorWrapper(p, this));
         }
         ps = new PropertyDescriptorCollection(list.ToArray());
         return(ps);
     }
     else
     {
         return(TypeDescriptor.GetProperties(this, attributes, true));
     }
 }
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection ps = TypeDescriptor.GetProperties(this, attributes, true);

            if (!VPLUtil.GetBrowseableProperties(attributes))
            {
                return(ps);
            }
            List <PropertyDescriptor> lst = new List <PropertyDescriptor>();

            foreach (PropertyDescriptor p in ps)
            {
                if (string.CompareOrdinal(p.Name, "TextDestination") == 0)
                {
                    if (DestinationType == EnumDataDestination.Database)
                    {
                        continue;
                    }
                }
                else if (string.CompareOrdinal(p.Name, "DatabaseDestination") == 0)
                {
                    if (DestinationType == EnumDataDestination.TextFile)
                    {
                        continue;
                    }
                }
                lst.Add(p);
            }
            return(new PropertyDescriptorCollection(lst.ToArray()));
        }
 public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
 {
     if (VPLUtil.GetBrowseableProperties(attributes))
     {
         PropertyDescriptorCollection ps   = TypeDescriptor.GetProperties(this, attributes, true);
         List <PropertyDescriptor>    list = new List <PropertyDescriptor>();
         foreach (PropertyDescriptor p in ps)
         {
             if (p.Name == Instance_Type)
             {
                 if (_var.ObjectType.IsPrimitive || _var.ObjectType.IsSealed || _var.ObjectType.IsValueType)
                 {
                     PropertyDescriptorForDisplay pd = new PropertyDescriptorForDisplay(this.GetType(), p.Name, _valType.ToString(), attributes);
                     list.Add(pd);
                 }
                 else
                 {
                     list.Add(p);
                 }
             }
             else
             {
                 list.Add(p);
             }
         }
         ps = new PropertyDescriptorCollection(list.ToArray());
         return(ps);
     }
     else
     {
         return(TypeDescriptor.GetProperties(this, attributes, true));
     }
 }
        public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection ps = TypeDescriptor.GetProperties(this, attributes, true);

            if (VPLUtil.GetBrowseableProperties(attributes))
            {
                MathNodeRoot mr = MathExp as MathNodeRoot;
                if (mr != null)
                {
                }
            }
            return(ps);
        }
Esempio n. 5
0
 public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
 {
     if (VPLUtil.GetBrowseableProperties(attributes))
     {
         PropertyDescriptor[] ps = new PropertyDescriptor[this.Count];
         for (int i = 0; i < this.Count; i++)
         {
             ps[i] = new PropertyDescriptorField(this[i]);
         }
         return(new PropertyDescriptorCollection(ps));
     }
     else
     {
         return(TypeDescriptor.GetProperties(this, attributes, true));
     }
 }
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection ps = TypeDescriptor.GetProperties(this, attributes, true);

            if (VPLUtil.GetBrowseableProperties(attributes))
            {
                List <PropertyDescriptor> list = new List <PropertyDescriptor>();
                foreach (PropertyDescriptor p in ps)
                {
                    if (IsOverride)
                    {
                        if (string.CompareOrdinal(p.Name, "EventHandlerType") == 0)
                        {
                            PropertyDescriptorForDisplay p0 = new PropertyDescriptorForDisplay(this.GetType(), p.Name, this.EventHandlerType.TypeName, attributes);
                            list.Add(p0);
                        }
                        else
                        {
                            ReadOnlyPropertyDesc p0 = new ReadOnlyPropertyDesc(p);
                            list.Add(p0);
                        }
                    }
                    else
                    {
                        list.Add(p);
                    }
                }
                if (this.EventHandlerType.IsGenericType)
                {
                    DataTypePointer[] tps = this.EventHandlerType.TypeParameters;
                    if (tps != null && tps.Length > 0)
                    {
                        Type[] tps0 = this.EventHandlerType.BaseClassType.GetGenericArguments();
                        if (tps0 != null && tps0.Length == tps.Length)
                        {
                            for (int i = 0; i < tps.Length; i++)
                            {
                                PropertyDescriptorForDisplay p0 = new PropertyDescriptorForDisplay(this.GetType(), tps0[i].Name, tps[i].BaseClassType.Name, attributes);
                                list.Add(p0);
                            }
                        }
                    }
                }
                ps = new PropertyDescriptorCollection(list.ToArray());
            }
            return(ps);
        }
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection ps = TypeDescriptor.GetProperties(this, attributes, true);

            if (!VPLUtil.GetBrowseableProperties(attributes))
            {
                return(ps);
            }
            List <PropertyDescriptor> lst = new List <PropertyDescriptor>();

            foreach (PropertyDescriptor p in ps)
            {
                if (string.CompareOrdinal(p.Name, "DataSource") == 0)
                {
                    if (EndPointType == enumDTType.Receiver)
                    {
                        continue;
                    }
                }
                else if (string.CompareOrdinal(p.Name, "DataDestination") == 0)
                {
                    if (EndPointType == enumDTType.Sender)
                    {
                        continue;
                    }
                }
                else if (string.CompareOrdinal(p.Name, "DataTransferMethod") == 0)
                {
                    if (EndPointType == enumDTType.Both)
                    {
                        continue;
                    }
                }
                lst.Add(p);
            }
            return(new PropertyDescriptorCollection(lst.ToArray()));
        }
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            List <PropertyDescriptor> lst = new List <PropertyDescriptor>();
            DatabaseExecuter          de  = this as DatabaseExecuter;

            if (de != null)
            {
                ParameterDirection[] pds = de.Param_Directions;
                if (pds != null && pds.Length > 0)
                {
                    DbParameterList pms = de.Parameters;
                    if (pms != null && pms.Count > 0)
                    {
                        for (int i = 0; i < pms.Count; i++)
                        {
                            ParameterDirection pd = ParameterDirection.Input;
                            if (pds != null && pds.Length > i)
                            {
                                pd = pds[i];
                            }
                            if (pd == ParameterDirection.Output || pd == ParameterDirection.InputOutput)
                            {
                                lst.Add(new PropertyDescriptorParam(pms[i]));
                            }
                        }
                    }
                }
            }
            PropertyDescriptorCollection ps = TypeDescriptor.GetProperties(this, attributes, true);

            if (typeof(EasyUpdator).Equals(this.GetType()) || typeof(DatabaseExecuter).Equals(this.GetType()))
            {
                foreach (PropertyDescriptor p in ps)
                {
                    lst.Add(p);
                }
            }
            else
            {
                bool forBrowsing = VPLUtil.GetBrowseableProperties(attributes);
                foreach (PropertyDescriptor p in ps)
                {
                    if (_subClassReadOnlyProperties.Contains(p.Name))
                    {
                        if (forBrowsing)
                        {
                            object v = p.GetValue(this);
                            string s;
                            if (v == null)
                            {
                                s = string.Empty;
                            }
                            else
                            {
                                s = v.ToString();
                            }
                            lst.Add(new PropertyDescriptorForDisplay(this.GetType(), p.Name, s, new Attribute[] { }));
                        }
                    }
                    else
                    {
                        lst.Add(p);
                    }
                }
            }
            return(new PropertyDescriptorCollection(lst.ToArray()));
        }