Bugzilla – Attachment 197665 Details for
Bug 365586
PropertyGrid: support DisplayNameAttribute
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
Repro code
PropGridObjManyTypes4.cs (text/plain), 30.64 KB, created by
Andy Hume
on 2008-02-28 13:59:24 UTC
(
hide
)
Description:
Repro code
Filename:
MIME Type:
Creator:
Andy Hume
Created:
2008-02-28 13:59:24 UTC
Size:
30.64 KB
patch
obsolete
>using System; >using System.Windows.Forms; >using System.Drawing; >using System.ComponentModel; // e.g. CategoryAttribute >using System.Globalization; // e.g. CultureInfo >using System.Text.RegularExpressions; >using System.Collections.Generic; >// > > >class PropGridObj >{ > #region Runner > static PropertyGrid pg1; > > static void Main() > { > MyVersionTypeConverterToFrom tcV = new MyVersionTypeConverterToFrom(); > Console.WriteLine("[v<-{0}]", tcV.ConvertFrom(null, null, "9.8.7.6")); > Console.WriteLine("[v<-{0}]", tcV.ConvertFrom(null, null, "v65009.8.7.6")); > // > TypeConverter tcCh = TypeDescriptor.GetConverter(typeof(Char)); > Console.WriteLine("[c~ {0}]", tcCh.GetType()); > // > String sc = (String)tcCh.ConvertTo((Char)0, typeof(String)); > Console.WriteLine("c->'{0}' len {1}", sc, sc.Length); > // > //Char c = (Char)tcCh.ConvertFrom(0); > //Console.WriteLine("'{0}'=0x{0:X}", c, (int)c); > //---- > RunGrid(); > } > > static void RunGrid() > { > Form f = new Form(); > f.Text = "PropGridObj"; > f.Height = 450; > // > pg1 = new PropertyGrid(); > pg1.Dock = DockStyle.Fill; > f.Controls.Add(pg1); > //---- > FlowLayoutPanel fp = new FlowLayoutPanel(); > fp.TabIndex = 2; > fp.Height = 50; > fp.Dock = DockStyle.Bottom; > // fp.VScroll = true; > f.Controls.Add(fp); > // > Button b; > // > b = new Button(); > b.AutoSize = true; > b.Text = "Refresh"; > b.Click += pg1refresh; > fp.Controls.Add(b); > // > b = new Button(); > b.Text = "Reset item"; > b.AutoSize = true; > b.Click += pg1resetSelectedProperty; > fp.Controls.Add(b); > // > b = new Button(); > b.Text = "Expand all"; > b.Click += pg1ExpandAllGridItems; > b.AutoSize = true; > fp.Controls.Add(b); > // > b = new Button(); > b.AutoSize = true; > b.Text = "Collapse all"; > b.Click += pg1CollapseAllGridItems; > fp.Controls.Add(b); > // > b = new Button(); > b.Text = "Add 10 To FooInt32"; > b.Click += pg1Add10ToFooInt32; > fp.Controls.Add(b); > b.AutoSize = true; > // > b = new Button(); > b.Text = "Toggle FooAnchorStyles"; > b.Click += pg1ToggleFooAnchorStyles; > fp.Controls.Add(b); > b.AutoSize = true; > //*************************************** > // > b = new Button(); > b.Text = "Tabs list"; > b.Click += pg1TabsList; > fp.Controls.Add(b); > b.AutoSize = true; > //*************************************** > //---- > pg1.SelectedObject = new FooBar1(); > // > Application.Run(f); > } > > private static void pg1resetSelectedProperty(Object sender, EventArgs e) > { > pg1.ResetSelectedProperty(); > } > > private static void pg1refresh(Object sender, EventArgs e) > { > pg1.Refresh(); > } > > private static void pg1ExpandAllGridItems(Object sender, EventArgs e) > { > pg1.ExpandAllGridItems(); > } > > private static void pg1CollapseAllGridItems(Object sender, EventArgs e) > { > pg1.CollapseAllGridItems(); > } > > private static void pg1Add10ToFooInt32(Object sender, EventArgs e) > { > FooBar1 target = (FooBar1)pg1.SelectedObject; > target.FooInt32 = 10 + target.FooInt32; > } > > private static void pg1ToggleFooAnchorStyles(Object sender, EventArgs e) > { > FooBar1 target = (FooBar1)pg1.SelectedObject; > AnchorStyles x = (AnchorStyles)(0xF & ((int)target.FooAnchorStyles << 1)); > if (x == 0) > x = (AnchorStyles)1; > target.FooAnchorStyles = x; > } > > private static void pg1TabsList(Object sender, EventArgs e) > { > PropertyGrid.PropertyTabCollection tabList = pg1.PropertyTabs; > MessageBox.Show("#=" + tabList.Count); > foreach (System.Windows.Forms.Design.PropertyTab curTab in tabList) { > MessageBox.Show("* " + curTab); > }//for > } > #endregion > >}//class > > > >class MyVersionTypeConverterToOnly : TypeConverter >{ > public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) > { > if (destinationType == typeof(String)) > return true; > return base.CanConvertTo(context, destinationType); > } > public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, > object value, Type destinationType) > { > if (value is Version && destinationType == typeof(String)) { > Version v = (Version)value; > return String.Format(CultureInfo.InvariantCulture, > "v{0}.{1}.{2}.{3}", v.Major, v.Minor, v.Build, v.Revision); > } > return base.ConvertTo(context, culture, value, destinationType); > } > >}//class > >class MyVersionTypeConverterToFrom : MyVersionTypeConverterToOnly >{ > public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) > { > if (sourceType == typeof(String)) > return true; > return CanConvertFrom(context, sourceType); > } > > public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) > { > if (value is String) { > Regex rx = new Regex(@"^v?([0-9]+)\.([0-9]+)\.([0-9]+)\.([(0-9]+)$"); > Match match = rx.Match((String)value); > if (match.Success) { > System.Diagnostics.Debug.Assert(match.Groups.Count == 5, "Expect 4 groups, plus input pseudo group"); > UInt16 mj, mi, bu, rv; > try { > mj = UInt16.Parse(match.Groups[1].Value); > mi = UInt16.Parse(match.Groups[2].Value); > bu = UInt16.Parse(match.Groups[3].Value); > rv = UInt16.Parse(match.Groups[4].Value); > } catch (FormatException ex) { > throw new FormatException("Each segment needs to be a number from 0 to 65535.", ex); > } > return new Version(mj, mi, bu, rv); > } else { > throw new FormatException("Need format [v]x.x.x.x, e.g. v1.2.3.4 or 91.2.65535.1"); > } > } > return base.ConvertFrom(context, culture, value); > } > >}//class > > >class MyVersionNullExpandableTypeConverterToOnly : ExpandableObjectConverter// TypeConverter >{ > //null >} > > > >// A test class to display in the PropertyGrid, it has properties of many type from >// the BCL, System.Drawing, and WinForms, some with default values and not. >// Every get_ or set_ is logged on the console. >// Buttons to refresh, reset, and update some fields are provided. >[DefaultProperty("FooInt32")] >public class FooBar1 >{ > #region Logging > // (Attempt to) separate user actions, by noting how far apart they appear. > int m_logTicks; > const int SingleOpTicks = 200; > > //-------- > void Log(bool newline, string format, params object[] args) > { > if (newline) > Console.WriteLine(); > // > int now = Environment.TickCount; > if (now - m_logTicks > SingleOpTicks) { > if (!newline) > Console.WriteLine(); > Console.WriteLine("--------"); > } > m_logTicks = now; > // > Console.Write(format + " ", args); > if (newline) > Console.WriteLine(); > } > > T DoGet<T>(string name, T field) > { > Log(false, "get-{0}", name); > return field; > } > > void DoSet<T>(string name, ref T field, T value) > { > Log(true, "*SET*-{0}: is {2}, was {1}", name, > ToStringQuotedOrNull(field), ToStringQuotedOrNull(value)); > field = value; > } > > void DoSetListProperty<T>(string name, ref T field, T value) > { > Log(true, "Set on list/array/etc property."); > //MessageBox.Show("Don't expect set of list/array/etc property."); > DoSet<T>(name, ref field, value); > } > > static String ToStringQuotedOrNull(object value) > { > if (value == null) { > return "(null)"; > } else { > return String.Format(System.Globalization.CultureInfo.InvariantCulture, > "'{0}'", value); > } > } > > #endregion > > > //-------- > #region Intrinsic type properties > String m_fooString; > [Category("Intrinsic types")] > public String FooString > { > get { return DoGet("FooString", m_fooString); } > set { DoSet("FooString", ref m_fooString, value); } > } > > String m_fooStringWithDefault = "hello world"; > [Category("Intrinsic types")] > [DefaultValue("hello world")] > public String FooStringWithDefault > { > get { return DoGet("FooStringWithDefault", m_fooStringWithDefault); } > set { DoSet("FooStringWithDefault", ref m_fooStringWithDefault, value); } > } > > String m_fooStringPassword; > [Category("Intrinsic types")] > [PasswordPropertyText(true)] > [DisplayName("Named FooStringPassword")] > [Description("Description and DisplayName too (no __'s!!!) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")] > public String __FooStringPassword > { > get { return DoGet("FooStringPassword", m_fooStringPassword); } > set { DoSet("FooStringPassword", ref m_fooStringPassword, value); } > } > > > DateTime m_fooDateTime; > [ Category( "Intrinsic types") ] > public DateTime FooDateTime > { > get { return DoGet("FooDateTime", m_fooDateTime); } > set { DoSet("FooDateTime", ref m_fooDateTime, value); } > } > > DateTime m_fooDateTimeWithDefault = new DateTime(2008, 02, 04, 14, 35, 0); > [Category("Intrinsic types")] > [DefaultValue(typeof(DateTime), "2008-02-04 14:35")] > public DateTime FooDateTimeWithDefault > { > get { return DoGet("FooDateTimeWithDefault", m_fooDateTimeWithDefault); } > set { DoSet("FooDateTimeWithDefault", ref m_fooDateTimeWithDefault, value); } > } > > DateTime? m_fooDateTimeNullable; > [Category("Intrinsic types")] > public DateTime? FooDateTimeNullable > { > get { return DoGet("FooDateTimeNullable", m_fooDateTimeNullable); } > set { DoSet("FooDateTimeNullable", ref m_fooDateTimeNullable, value); } > } > > Int32 m_fooInt32; > [Category("Intrinsic types")] > public Int32 FooInt32 > { > get { return DoGet("FooInt32", m_fooInt32); } > set { DoSet("FooInt32", ref m_fooInt32, value); } > } > > Int32? m_fooInt32Nullable; > [Category("Intrinsic types")] > public Int32? FooInt32Nullable > { > get { return DoGet("FooInt32Nullable", m_fooInt32Nullable); } > set { DoSet("FooInt32Nullable", ref m_fooInt32Nullable, value); } > } > > Int32 m_fooInt32WithDefault = 5; > [Category("Intrinsic types")] > [DefaultValue(5)] > public Int32 FooInt32WithDefault > { > get { return DoGet("FooInt32WithDefault", m_fooInt32WithDefault); } > set { DoSet("FooInt32WithDefault", ref m_fooInt32WithDefault, value); } > } > > Int32 m_fooInt32WithDefaultReadOnly = 50; > [Category("Intrinsic types")] > [DefaultValue(50)] > [ReadOnly(true)] > public Int32 FooInt32WithDefaultReadOnly > { > get { return DoGet("FooInt32WithDefaultReadOnly", m_fooInt32WithDefaultReadOnly); } > set { DoSet("FooInt32WithDefaultReadOnly", ref m_fooInt32WithDefaultReadOnly, value); } > } > > Int32 m_fooInt32HiddenWithDefault = 51; > [Category("Intrinsic types")] > [DefaultValue(51)] > [Browsable(false)] > public Int32 FooInt32HiddenWithDefault > { > get { return DoGet("FooInt32HiddenWithDefault", m_fooInt32HiddenWithDefault); } > set { DoSet("FooInt32HiddenWithDefault", ref m_fooInt32HiddenWithDefault, value); } > } > > Boolean m_fooBoolean; > [Category("Intrinsic types")] > [ParenthesizePropertyName(true)] > public Boolean FooBoolean > { > get { return DoGet("FooBoolean", m_fooBoolean); } > set { DoSet("FooBoolean", ref m_fooBoolean, value); } > } > > Char m_fooChar; > [Category("Intrinsic types")] > public Char FooChar > { > get { return DoGet("FooChar", m_fooChar); } > set { DoSet("FooChar", ref m_fooChar, value); } > } > > Double m_fooDouble; > [Category("Intrinsic types")] > public Double FooDouble > { > get { return DoGet("FooDouble", m_fooDouble); } > set { DoSet("FooDouble", ref m_fooDouble, value); } > } > > System.Globalization.CultureInfo m_fooCultureInfo; > [Category("Intrinsic types")] > public System.Globalization.CultureInfo FooCultureInfo > { > get { return DoGet("FooCultureInfo", m_fooCultureInfo); } > set { DoSet("FooCultureInfo", ref m_fooCultureInfo, value); > Console.WriteLine("[" +m_fooCultureInfo.DisplayName + " / " > + m_fooCultureInfo.EnglishName + " / " > + m_fooCultureInfo.NativeName + "]"); > } > } > > #endregion > > > #region corlib properties > > PlatformID m_fooEnumPlatformID; > [Category("mscorlib")] > public PlatformID FooEnumPlatformID > { > get { return DoGet("FooEnumPlatformID", m_fooEnumPlatformID); } > set { DoSet("FooEnumPlatformID", ref m_fooEnumPlatformID, value); } > } > > System.Reflection.BindingFlags m_fooEnumBindingFlags; > [Category("mscorlib")] > public System.Reflection.BindingFlags FooEnumBindingFlags > { > get { return DoGet("FooEnumBindingFlags", m_fooEnumBindingFlags); } > set { DoSet("FooEnumBindingFlags", ref m_fooEnumBindingFlags, value); } > } > > Guid m_fooGuid; > [Category("mscorlib")] > public Guid FooGuid > { > get { return DoGet("FooGuid", m_fooGuid); } > set { DoSet("FooGuid", ref m_fooGuid, value); } > } > > TimeSpan m_fooTimeSpan; > [Category("mscorlib")] > public TimeSpan FooTimeSpan > { > get { return DoGet("FooTimeSpan", m_fooTimeSpan); } > set { DoSet("FooTimeSpan", ref m_fooTimeSpan, value); } > } > > TimeSpan m_fooTimeSpanWithInit = new TimeSpan(500, 1, 2, 3, 4); > [Category("mscorlib")] > public TimeSpan FooTimeSpanWithInit > { > get { return DoGet("FooTimeSpanWithInit", m_fooTimeSpanWithInit); } > set { DoSet("FooTimeSpanWithInit", ref m_fooTimeSpanWithInit, value); } > } > > > //---- > Version m_fooVersion; > [Category("mscorlib")] > public Version FooVersion > { > get { return DoGet("FooVersion", m_fooVersion); } > set { DoSet("FooVersion", ref m_fooVersion, value); } > } > > Version m_fooVersionWithDefaultVariable = new Version(1, 2, 3, 4); > [Category("mscorlib")] > public Version FooVersionWithDefaultVariable > { > get { return DoGet("FooVersionWithDefaultVariable", m_fooVersionWithDefaultVariable); } > set { DoSet("FooVersionWithDefaultVariable", ref m_fooVersionWithDefaultVariable, value); } > } > #endregion > > > #region System properties > Uri m_fooUri; > [Category("mscorlib")] > public Uri FooUri > { > get { return DoGet("FooUri", m_fooUri); } > set { DoSet("FooUri", ref m_fooUri, value); } > } > > Uri m_fooUriWithDefault = new Uri("http://www.mono-project.com/Main_Page"); > [Category("mscorlib")] > [DefaultValue(typeof(Uri), "http://www.mono-project.com/Main_Page")] > public Uri FooUriWithDefault > { > get { return DoGet("FooUriWithDefault", m_fooUriWithDefault); } > set { DoSet("FooUriWithDefault", ref m_fooUriWithDefault, value); } > } > #endregion > > > #region System.Drawing properties > Size m_fooSize; > [Category("System.Drawing")] > public Size FooSize > { > get { return DoGet("FooSize", m_fooSize); } > set { DoSet("FooSize", ref m_fooSize, value); } > } > > SizeF m_fooSizeF; > [Category("System.Drawing")] > public SizeF FooSizeF > { > get { return DoGet("FooSizeF", m_fooSizeF); } > set { DoSet("FooSizeF", ref m_fooSizeF, value); } > } > > Color m_fooColor; > [Category("System.Drawing")] > public Color FooColor > { > get { return DoGet("FooColor", m_fooColor); } > set { DoSet("FooColor", ref m_fooColor, value); } > } > > Color m_fooColorWithDefault = Color.Red; > [Category("System.Drawing")] > [DefaultValue(typeof(Color), "Red")] > public Color FooColorWithDefault > { > get { return DoGet("FooColorWithDefault", m_fooColorWithDefault); } > set { DoSet("FooColorWithDefault", ref m_fooColorWithDefault, value); } > } > > Rectangle m_fooRectangle; > [Category("System.Drawing")] > public Rectangle FooRectangle > { > get { return DoGet("FooRectangle", m_fooRectangle); } > set { DoSet("FooRectangle", ref m_fooRectangle, value); } > } > > Rectangle m_fooRectangleNoSetter = new Rectangle(1, 2, 13, 14); > [Category("System.Drawing")] > public Rectangle FooRectangleNoSetter > { > get { return DoGet("FooRectangleNoSetter", m_fooRectangleNoSetter); } > } > > Point m_fooPoint; > [Category("System.Drawing")] > public Point FooPoint > { > get { return DoGet("FooPoint", m_fooPoint); } > set { DoSet("FooPoint", ref m_fooPoint, value); } > } > > Font m_fooFont; > [Category("System.Drawing")] > public Font FooFont > { > get { return DoGet("FooFont", m_fooFont); } > set { DoSet("FooFont", ref m_fooFont, value); } > } > > Icon m_fooIcon; > [Category("System.Drawing")] > public Icon FooIcon > { > get { return DoGet("FooIcon", m_fooIcon); } > set { DoSet("FooIcon", ref m_fooIcon, value); } > } > > Image m_fooImage; > [Category("System.Drawing")] > public Image FooImage > { > get { return DoGet("FooImage", m_fooImage); } > set { DoSet("FooImage", ref m_fooImage, value); } > } > > System.Drawing.Imaging.ImageFormat m_fooImageFormat; > [Category("System.Drawing")] > public System.Drawing.Imaging.ImageFormat FooImageFormat > { > get { return DoGet("FooImageFormat", m_fooImageFormat); } > set { DoSet("FooImageFormat", ref m_fooImageFormat, value); } > } > > #endregion > > > #region WinForms properties > DockStyle m_fooDockStyle; > [Category("WinForms")] > public DockStyle FooDockStyle > { > get { return DoGet("FooDockStyle", m_fooDockStyle); } > set { DoSet("FooDockStyle", ref m_fooDockStyle, value); } > } > > AnchorStyles m_fooAnchorStyles; > [Category("WinForms")] > public AnchorStyles FooAnchorStyles > { > get { return DoGet("FooAnchorStyles", m_fooAnchorStyles); } > set { DoSet("FooAnchorStyles", ref m_fooAnchorStyles, value); } > } > > AnchorStyles m_fooAnchorStylesWithDefault = AnchorStyles.Top | AnchorStyles.Left; > [Category("WinForms")] > [DefaultValue(AnchorStyles.Top | AnchorStyles.Left)] > public AnchorStyles FooAnchorStylesWithDefault > { > get { return DoGet("FooAnchorStylesWithDefault", m_fooAnchorStylesWithDefault); } > set { DoSet("FooAnchorStylesWithDefault", ref m_fooAnchorStylesWithDefault, value); } > } > > Cursor m_fooCursor; > [Category("WinForms")] > public Cursor FooCursor > { > get { return DoGet("FooCursor", m_fooCursor); } > set { DoSet("FooCursor", ref m_fooCursor, value); } > } > > Keys m_fooKeys; > [Category("WinForms")] > public Keys FooKeys > { > get { return DoGet("FooKeys", m_fooKeys); } > set { DoSet("FooKeys", ref m_fooKeys, value); } > } > > ImeMode m_fooImeMode; > [Category("WinForms")] > public ImeMode FooImeMode > { > get { return DoGet("FooImeMode", m_fooImeMode); } > set { DoSet("FooImeMode", ref m_fooImeMode, value); } > } > > Double m_fooOpacity; > [Category("WinForms")] > [TypeConverter(typeof(OpacityConverter))] > public Double FooOpacity > { > get { return DoGet("FooOpacity", m_fooOpacity); } > set { DoSet("FooOpacity", ref m_fooOpacity, value); } > } > > Padding m_fooPadding; > [Category("WinForms")] > public Padding FooPadding > { > get { return DoGet("FooPadding", m_fooPadding); } > set { DoSet("FooPadding", ref m_fooPadding, value); } > } > > SelectionRange m_fooSelectionRange; > [Category("WinForms")] > public SelectionRange FooSelectionRange > { > get { return DoGet("FooSelectionRange", m_fooSelectionRange); } > set { DoSet("FooSelectionRange", ref m_fooSelectionRange, value); } > } > > SelectionRange m_fooSelectionRangeInitEmpty = new SelectionRange(); > [Category("WinForms" )] > public SelectionRange FooSelectionRangeInitEmpty > { > get { return DoGet ("FooSelectionRangeInitEmpty", m_fooSelectionRangeInitEmpty); } > set { DoSet("FooSelectionRangeInitEmpty", ref m_fooSelectionRangeInitEmpty, value); } > } > > SelectionRange m_fooSelectionRangeInit = new SelectionRange(new DateTime(2001, 1, 1), new DateTime(2008, 2, 14)); > [Category("WinForms")] > public SelectionRange FooSelectionRangeInit > { > get { return DoGet("FooSelectionRangeInit", m_fooSelectionRangeInit); } > set { DoSet("FooSelectionRangeInit", ref m_fooSelectionRangeInit, value); } > } > > //DockPaddingEdges m_fooDockPaddingEdges; > //[Category("WinForms")] > //public DockPaddingEdges FooDockPaddingEdges > //{ > // get { return DoGet("FooDockPaddingEdges", m_fooDockPaddingEdges); } > // set { DoSet("FooDockPaddingEdges", ref m_fooDockPaddingEdges, value); } > //} > > TreeNode m_fooTreeNode; > [Category("WinForms")] > public TreeNode FooTreeNode > { > get { return DoGet("FooTreeNode", m_fooTreeNode); } > set { DoSet("FooTreeNode", ref m_fooTreeNode, value); } > } > > TreeNode m_fooTreeNodeInitEmpty = new TreeNode(); > [Category("WinForms")] > public TreeNode FooTreeNodeInitEmpty > { > get { return DoGet("FooTreeNodeInitEmpty", m_fooTreeNodeInitEmpty); } > set { DoSet("FooTreeNodeInitEmpty", ref m_fooTreeNodeInitEmpty, value); } > } > > LinkArea m_fooLinkArea; > [Category("WinForms")] > public LinkArea FooLinkArea > { > get { return DoGet("FooLinkArea", m_fooLinkArea); } > set { DoSet("FooLinkArea", ref m_fooLinkArea, value); } > } > > //Link m_fooLink; > //[Category("WinForms")] > //public Link FooLink > //{ > // get { return DoGet("FooLink", m_fooLink); } > // set { DoSet("FooLink", ref m_fooLink, value); } > //} > > //ListBinding m_fooListBinding; > //[Category("WinForms")] > //public ListBinding FooListBinding > //{ > // get { return DoGet("FooListBinding", m_fooListBinding); } > // set { DoSet("FooListBinding", ref m_fooListBinding, value); } > //} > > TableLayoutSettings m_fooTableLayoutSettings; > [Category("WinForms")] > public TableLayoutSettings FooTableLayoutSettings > { > get { return DoGet("FooTableLayoutSettings", m_fooTableLayoutSettings); } > set { DoSet("FooTableLayoutSettings", ref m_fooTableLayoutSettings, value); } > } > > #endregion > > > #region Attributes on Properties > Version m_fooVersion1 = new Version(1, 2, 3, 4); > [Category("my Attributes on Properties")] > public Version FooVersion1 > { > get { return DoGet("FooVersion1", m_fooVersion1); } > set { DoSet("FooVersion1", ref m_fooVersion1, value); } > } > > > Version m_fooVersion2WithToTc = new Version(10, 2, 3, 4); > [Category("my Attributes on Properties")] > [TypeConverter("MyVersionTypeConverterToOnly")] > public Version FooVersion2WithToTc > { > get { return DoGet("FooVersion2WithToTc", m_fooVersion2WithToTc); } > set { DoSet("FooVersion2WithToTc", ref m_fooVersion2WithToTc, value); } > } > > Version m_fooVersion3WithTypeConv = new Version(100, 2, 3, 4); > [Category("my Attributes on Properties")] > [TypeConverter("MyVersionTypeConverterToFrom")] > public Version FooVersion3WithTypeConv > { > get { return DoGet("FooVersion3WithTypeConv", m_fooVersion3WithTypeConv); } > set { DoSet("FooVersion3WithTypeConv", ref m_fooVersion3WithTypeConv, value); } > } > > > Version m_fooVersion4TypeofWithToTc = new Version(10, 2, 3, 4); > [Category("my Attributes on Properties")] > [TypeConverter(typeof(MyVersionTypeConverterToOnly))] > public Version FooVersion4TypeofWithToTc > { > get { return DoGet("FooVersion4TypeofWithToTc", m_fooVersion4TypeofWithToTc); } > set { DoSet("FooVersion4TypeofWithToTc", ref m_fooVersion4TypeofWithToTc, value); } > } > > Version m_fooVersion5TypeofWithTypeConv = new Version(100, 2, 3, 4); > [Category("my Attributes on Properties")] > [TypeConverter(typeof(MyVersionTypeConverterToFrom))] > public Version FooVersion5TypeofWithTypeConvTypeof > { > get { return DoGet("FooVersion5TypeofWithTypeConv", m_fooVersion5TypeofWithTypeConv); } > set { DoSet("FooVersion5TypeofWithTypeConv", ref m_fooVersion5TypeofWithTypeConv, value); } > } > > > Version m_fooVersion6WithExpandableTc = new Version(100, 2, 3, 5); > [Category("my Attributes on Properties")] > [TypeConverter(typeof(MyVersionNullExpandableTypeConverterToOnly))] > [ParenthesizePropertyName(true)] > public Version FooVersion6WithExpandableTc > { > get { return DoGet("FooVersion6WithExpandableTc", m_fooVersion6WithExpandableTc); } > set { DoSet("FooVersion6WithExpandableTc", ref m_fooVersion6WithExpandableTc, value); } > } > #endregion > > > #region Array > String[] m_fooStringArray; > [Category("xiii Array")] > public String[] FooStringArray > { > get { return DoGet("FooStringArray", m_fooStringArray); } > set { DoSetListProperty("FooStringArray", ref m_fooStringArray, value); } > } > > String[] m_fooStringArrayInitialised = { "aa" }; > [Category("xiii Array")] > public String[] FooStringArrayInitialised > { > get { return DoGet("FooStringArrayInitialised", m_fooStringArrayInitialised); } > set { DoSetListProperty("FooStringArrayInitialised", ref m_fooStringArrayInitialised, value); } > } > > Int32[] m_fooInt32Array; > [Category("xiii Array")] > public Int32[] FooInt32Array > { > get { return DoGet("FooInt32Array", m_fooInt32Array); } > set { DoSetListProperty("FooInt32Array", ref m_fooInt32Array, value); } > } > > Int32[] m_fooInt32ArrayInitialised = { 1, 5, 999 }; > [Category("xiii Array")] > public Int32[] FooInt32ArrayInitialised > { > get { return DoGet("FooInt32ArrayInitialised", m_fooInt32ArrayInitialised); } > set { DoSetListProperty("FooInt32ArrayInitialised", ref m_fooInt32ArrayInitialised, value); } > } > > Int32[] m_fooInt32ArrayInitEmpty = { }; > [Category("xiii Array")] > public Int32[] FooInt32ArrayInitEmpty > { > get { return DoGet("FooInt32ArrayInitEmpty", m_fooInt32ArrayInitEmpty); } > set { DoSetListProperty("FooInt32ArrayInitEmpty", ref m_fooInt32ArrayInitEmpty, value); } > } > > Point[] m_fooPointArray; > [Category("xiii Array")] > public Point[] FooPointArray > { > get { return DoGet("FooPointArray", m_fooPointArray); } > set { DoSetListProperty("FooPointArray", ref m_fooPointArray, value); } > } > > Point[] m_fooPointArrayInitEmpty = new Point[0]; > [Category("xiii Array")] > public Point[] FooPointArrayInitEmpty > { > get { return DoGet("FooPointArrayInitEmpty", m_fooPointArrayInitEmpty); } > set { DoSetListProperty("FooPointArrayInitEmpty", ref m_fooPointArrayInitEmpty, value); } > } > > PlatformID[] m_fooPlatformIDArrayInitEmpty = new PlatformID[0]; > [Category("xiii Array")] > public PlatformID[] FooPlatformIDArrayInitEmpty > { > get { return DoGet("FooPlatformIDArrayInitEmpty", m_fooPlatformIDArrayInitEmpty); } > set { DoSetListProperty("FooPlatformIDArrayInitEmpty", ref m_fooPlatformIDArrayInitEmpty, value); } > } > #endregion > > #region ListT > List<String> m_fooStringListT; > [Category("xjjj ListT")] > public List<String> FooStringListT > { > get { return DoGet("FooStringListT", m_fooStringListT); } > set { DoSetListProperty("FooStringListT", ref m_fooStringListT, value); } > } > > //TODO List<String> m_fooStringListTInitialised = { "aa" }; > //[Category("xjjj ListT")] > //public List<String> FooStringListTInitialised > //{ > // get { return DoGet("FooStringListTInitialised", m_fooStringListTInitialised); } > // set { DoSetListProperty("FooStringListTInitialised", ref m_fooStringListTInitialised, value); } > //} > > List<Int32> m_fooInt32ListT; > [Category("xjjj ListT")] > public List<Int32> FooInt32ListT > { > get { return DoGet("FooInt32ListT", m_fooInt32ListT); } > set { DoSetListProperty("FooInt32ListT", ref m_fooInt32ListT, value); } > } > > //TODO List<Int32> m_fooInt32ListTInitialised = { 1, 5, 999 }; > //[Category("xjjj ListT")] > //public List<Int32> FooInt32ListTInitialised > //{ > // get { return DoGet("FooInt32ListTInitialised", m_fooInt32ListTInitialised); } > // set { DoSetListProperty("FooInt32ListTInitialised", ref m_fooInt32ListTInitialised, value); } > //} > > List<Int32> m_fooInt32ListTInitEmpty = new List<Int32>(); > [Category("xjjj ListT")] > public List<Int32> FooInt32ListTInitEmpty > { > get { return DoGet("FooInt32ListTInitEmpty", m_fooInt32ListTInitEmpty); } > set { DoSetListProperty("FooInt32ListTInitEmpty", ref m_fooInt32ListTInitEmpty, value); } > } > > List<Point> m_fooPointListT; > [Category("xjjj ListT")] > public List<Point> FooPointListT > { > get { return DoGet("FooPointListT", m_fooPointListT); } > set { DoSetListProperty("FooPointListT", ref m_fooPointListT, value); } > } > > List<Point> m_fooPointListTInitEmpty = new List<Point>(); > [Category("xjjj ListT")] > public List<Point> FooPointListTInitEmpty > { > get { return DoGet("FooPointListTInitEmpty", m_fooPointListTInitEmpty); } > set { DoSetListProperty("FooPointListTInitEmpty", ref m_fooPointListTInitEmpty, value); } > } > > List<PlatformID> m_fooPlatformIDListTInitEmpty = new List<PlatformID>(); > [Category("xjjj ListT")] > public List<PlatformID> FooPlatformIDListTInitEmpty > { > get { return DoGet("FooPlatformIDListTInitEmpty", m_fooPlatformIDListTInitEmpty); } > set { DoSetListProperty("FooPlatformIDListTInitEmpty", ref m_fooPlatformIDListTInitEmpty, value); } > } > #endregion > >}//class >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 365586
: 197665