/// <summary>
        /// This should launch an open file dialog instead of the usual thing.
        /// </summary>
        /// <param name="context">System.ComponentModel.ITypeDescriptorContext</param>
        /// <param name="provider">IServiceProvider</param>
        /// <param name="value">The object being displayed</param>
        /// <returns>A new version of the object if the dialog was ok.</returns>
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _context = context;
            _original = value as IPolygonScheme;
            _editCopy = _original.Copy();

            
            IWindowsFormsEditorService dialogProvider = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            NamedList<IPolygonCategory> cats = new NamedList<IPolygonCategory>(_editCopy.Categories, "Category");
            CollectionPropertyGrid frm = new CollectionPropertyGrid(cats);
            frm.ChangesApplied += new EventHandler(frm_ChangesApplied);
            frm.AddItemClicked += new EventHandler(frm_AddItemClicked);
            dialogProvider.ShowDialog(frm);
            return _original; // don't bother swapping out the edit copy, just store copies of the categories when changes are applied.
        }
        /// <summary>
        /// This describes how to launch the form etc.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _context = context;   
          

            IWindowsFormsEditorService dialogProvider = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            SQLExpressionDialog dlgExpression = new SQLExpressionDialog();
            string original = (string)value;
            dlgExpression.Expression = (string)value;

            // Try to find the Table
            IFeatureCategory category = context.Instance as IFeatureCategory;
            if (category != null)
            {
                IFeatureScheme scheme = category.GetParentItem() as IFeatureScheme;
                if (scheme != null)
                {
                    IFeatureLayer layer = scheme.GetParentItem() as IFeatureLayer;
                    if (layer != null)
                    {
                        dlgExpression.Table = layer.DataSet.DataTable;
                    }
                }
                else
                {
                    IFeatureLayer layer = category.GetParentItem() as IFeatureLayer;
                    if (layer != null)
                    {
                        dlgExpression.Table = layer.DataSet.DataTable;
                    }
                }
            }

            dlgExpression.ChangesApplied += dlgExpression_ChangesApplied;
            if (dialogProvider.ShowDialog(dlgExpression) != System.Windows.Forms.DialogResult.OK)
            {
                return original;
            }
            else
            {
                return dlgExpression.Expression;
            }
            
        }
Example #3
0
 public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context)
 {
     throw null;
 }
Example #4
0
 public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType)
 {
     throw null;
 }
Example #5
0
 public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType)
 {
     throw null;
 }
Example #6
0
 /// <summary>
 /// Returns whether this object supports a standard set of values that can be picked from a list, using the specified context.
 /// </summary>
 /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context.</param>
 /// <returns>
 /// true if <see cref="M:System.ComponentModel.TypeConverter.GetStandardValues"></see> should be called to find a common set of values the object supports; otherwise, <c>false</c>.
 /// </returns>
 public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context)
 {
     return(this.baseTypeConverter.GetStandardValuesSupported(context));
 }
Example #7
0
 /// <summary>
 /// Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes.
 /// </summary>
 /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context.</param>
 /// <param name="value">An <see cref="T:System.Object"></see> that specifies the type of array for which to get properties.</param>
 /// <param name="attributes">An array of type <see cref="T:System.Attribute"></see> that is used as a filter.</param>
 /// <returns>
 /// A <see cref="T:System.ComponentModel.PropertyDescriptorCollection"></see> with the properties that are exposed for this data type, or null if there are no properties.
 /// </returns>
 public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, Attribute[] attributes)
 {
     return(this.baseTypeConverter.GetProperties(context, value, attributes));
 }
Example #8
0
 /// <summary>
 /// Creates an instance of the type that this <see cref="T:System.ComponentModel.TypeConverter"></see> is associated with, using the specified context, given a set of property values for the object.
 /// </summary>
 /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context.</param>
 /// <param name="propertyValues">An <see cref="T:System.Collections.IDictionary"></see> of new property values.</param>
 /// <returns>
 /// An <see cref="T:System.Object"></see> representing the given <see cref="T:System.Collections.IDictionary"></see>, or <c>null</c> if the object can not be created.
 /// This method always returns <c>null</c>.
 /// </returns>
 public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues)
 {
     return(baseTypeConverter.CreateInstance(context, propertyValues));
 }
Example #9
0
 public virtual bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context)
 {
 }
Example #10
0
 public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes)
 {
 }
Example #11
0
 public virtual bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context)
 {
 }
Example #12
0
 public virtual object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues)
 {
 }
Example #13
0
 public virtual object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
 {
 }
Example #14
0
 public virtual bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context)
 {
 }
Example #15
0
 public virtual bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context)
 {
 }
Example #16
0
 public virtual System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context)
 {
 }
Example #17
0
 /// <summary>
 /// Returns whether this converter can convert the object to the specified type, using the specified context.
 /// </summary>
 /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context.</param>
 /// <param name="destinationType">A <see cref="T:System.Type"></see> that represents the type you want to convert to.</param>
 /// <returns>
 /// true if this converter can perform the conversion; otherwise, <c>false</c>.
 /// </returns>
 public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context,
                                   Type destinationType)
 {
     return((destinationType == typeof(string)) || baseTypeConverter.CanConvertTo(context, destinationType));
 }
Example #18
0
 public virtual bool IsValid(System.ComponentModel.ITypeDescriptorContext context, object value)
 {
 }
Example #19
0
 /// <summary>
 /// Returns whether changing a value on this object requires a call to <see cref="M:System.ComponentModel.TypeConverter.CreateInstance(System.Collections.IDictionary)"></see> to create a new value, using the specified context.
 /// </summary>
 /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context.</param>
 /// <returns>
 /// true if changing a property on this object requires a call to <see cref="M:System.ComponentModel.TypeConverter.CreateInstance(System.Collections.IDictionary)"></see> to create a new value; otherwise, <c>false</c>.
 /// </returns>
 public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context)
 {
     return(this.baseTypeConverter.GetCreateInstanceSupported(context));
 }
Example #20
0
 public virtual bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, Type destinationType)
 {
 }
Example #21
0
 /// <summary>
 /// Returns a collection of standard values for the data type this type converter is designed for when provided with a format context.
 /// </summary>
 /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context that can be used to extract additional information about the environment from which this converter is invoked. This parameter or properties of this parameter can be null.</param>
 /// <returns>
 /// A <see cref="T:System.ComponentModel.TypeConverter.StandardValuesCollection"></see> that holds a standard set of valid values, or null if the data type does not support a standard set of values.
 /// </returns>
 public override StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context)
 {
     return(this.baseTypeConverter.GetStandardValues(context));
 }
Example #22
0
 // Methods
 public virtual bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, Type sourceType)
 {
 }
Example #23
0
 public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context)
 {
     throw null;
 }
Example #24
0
 public object ConvertFromString(System.ComponentModel.ITypeDescriptorContext context, string text)
 {
 }
Example #25
0
 public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType)
 {
     throw null;
 }
Example #26
0
 public object ConvertFromString(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, string text)
 {
 }
Example #27
0
 public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues)
 {
     throw null;
 }
Example #28
0
 public string ConvertToInvariantString(System.ComponentModel.ITypeDescriptorContext context, object value)
 {
 }
Example #29
0
 public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes)
 {
     throw null;
 }
Example #30
0
 /// <summary>
 /// 获取由 EditValue 方法使用的编辑器样式
 /// </summary>
 /// <param name="context">可用于获取附加上下文信息的 ITypeDescriptorContext</param>
 /// <returns>UITypeEditorEditStyle  值,指示 EditValue 方法使用的编辑器样式。 如果 UITypeEditor 不支持该方法,则 GetEditStyle 将返回 None</returns>
 public override UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
 {
     return(UITypeEditorEditStyle.Modal);
 }
Example #31
0
 /// <summary>
 /// Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.
 /// </summary>
 /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context.</param>
 /// <param name="sourceType">A <see cref="T:System.Type"></see> that represents the type you want to convert from.</param>
 /// <returns>
 /// true if this converter can perform the conversion; otherwise, <c>false</c>.
 /// </returns>
 public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context,
                                     Type sourceType)
 {
     return((sourceType == typeof(string)) || baseTypeConverter.CanConvertFrom(context, sourceType));
 }
Example #32
0
 public System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value)
 {
 }