コード例 #1
0
            //private bool                 standardValuesQueried;

            public Com2IPerPropertyBrowsingEnum(Com2PropertyDescriptor targetObject, Com2IPerPropertyBrowsingHandler handler, OleStrCAMarshaler names, Int32CAMarshaler values, bool allowUnknowns) : base(new string[0], new object[0], allowUnknowns)
            {
                this.target          = targetObject;
                this.nameMarshaller  = names;
                this.valueMarshaller = values;
                this.handler         = handler;
                this.arraysFetched   = false;
            }
コード例 #2
0
 public Com2IPerPropertyBrowsingEnum(Com2PropertyDescriptor targetObject, Com2IPerPropertyBrowsingHandler handler, OleStrCAMarshaler names, Int32CAMarshaler values, bool allowUnknowns) : base(Array.Empty <string>(), Array.Empty <object>(), allowUnknowns)
 {
     target          = targetObject;
     nameMarshaller  = names;
     valueMarshaller = values;
     this.handler    = handler;
     arraysFetched   = false;
 }
 public override string ToString(object v)
 {
     if (this.target.IsCurrentValue(v))
     {
         bool   success = false;
         string str     = Com2IPerPropertyBrowsingHandler.GetDisplayString((System.Windows.Forms.NativeMethods.IPerPropertyBrowsing) this.target.TargetObject, this.target.DISPID, ref success);
         if (success)
         {
             return(str);
         }
     }
     this.EnsureArrays();
     return(base.ToString(v));
 }
 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, System.Type destType)
 {
     if ((destType == typeof(string)) && !this.itemsEnum.arraysFetched)
     {
         object obj2 = this.itemsEnum.target.GetValue(this.itemsEnum.target.TargetObject);
         if ((obj2 == value) || ((obj2 != null) && obj2.Equals(value)))
         {
             bool   success = false;
             string str     = Com2IPerPropertyBrowsingHandler.GetDisplayString((System.Windows.Forms.NativeMethods.IPerPropertyBrowsing) this.itemsEnum.target.TargetObject, this.itemsEnum.target.DISPID, ref success);
             if (success)
             {
                 return(str);
             }
         }
     }
     return(base.ConvertTo(context, culture, value, destType));
 }
コード例 #5
0
            public override string ToString(object v)
            {
                // If the value is the object's current value, then
                // ask GetDisplay string first.  This is a perf improvement
                // because this way we don't populate the arrays when an object is selected, only
                // when the dropdown is actually opened.
                //
                if (target.IsCurrentValue(v))
                {
                    bool success = false;

                    string displayString = Com2IPerPropertyBrowsingHandler.GetDisplayString((NativeMethods.IPerPropertyBrowsing)target.TargetObject, target.DISPID, ref success);

                    if (success)
                    {
                        return(displayString);
                    }
                }

                // couldn't get a display string...do the normal thing.
                //
                EnsureArrays();
                return(base.ToString(v));
            }
コード例 #6
0
     //private bool                 standardValuesQueried;
 
     public Com2IPerPropertyBrowsingEnum(Com2PropertyDescriptor targetObject, Com2IPerPropertyBrowsingHandler handler, OleStrCAMarshaler names, Int32CAMarshaler values, bool allowUnknowns) : base(new string[0], new object[0], allowUnknowns) {
        this.target = targetObject;
        this.nameMarshaller = names;
        this.valueMarshaller = values;
        this.handler = handler;
        this.arraysFetched = false;
     }
 public Com2IPerPropertyEnumConverter(Com2IPerPropertyBrowsingHandler.Com2IPerPropertyBrowsingEnum items) : base(items)
 {
     this.itemsEnum = items;
 }