void InitializeFields(ExtractInterfaceOptions o) { this.options = o; this.txtInterfaceName.Text = o.NewInterfaceName; this.txtNewFileName.Text = o.SuggestedFileName; this.txtGeneratedName.Text = o.FullyQualifiedName; IClass c = o.ClassEntity; foreach (IMethod m in c.Methods) { if (m.IsPublic && !m.IsConstructor && !m.IsConst && !m.IsStatic) { this.possibleInterfaceMembers.Add(m); this.selectMembersListBox.Items.Add(FormatMemberForDisplay(m), CheckState.Checked); } } foreach (IProperty p in c.Properties) { if (p.IsPublic && !p.IsConst && !p.IsStatic) { this.possibleInterfaceMembers.Add(p); this.selectMembersListBox.Items.Add(FormatMemberForDisplay(p), CheckState.Checked); } } }
/// <summary> /// A custom ShowDialog routine that handles pass-through deserialization and reserialization /// of a <see cref="ExtractInterfaceOptions"/> object to encapsulate this operation's /// parameters. /// </summary> /// <param name="options"> /// A <see cref="ExtractInterfaceOptions"/> containing initial, default values for the operation. /// </param> /// <returns> /// A <see cref="ExtractInterfaceOptions"/> reference encapsulating the dialog's parameters. /// </returns> public ExtractInterfaceOptions ShowDialog(ExtractInterfaceOptions options) { InitializeFields(options); options.IsCancelled = (base.ShowDialog() == DialogResult.Cancel); return(options); }
/// <summary> /// A custom ShowDialog routine that handles pass-through deserialization and reserialization /// of a <see cref="ExtractInterfaceOptions"/> object to encapsulate this operation's /// parameters. /// </summary> /// <param name="options"> /// A <see cref="ExtractInterfaceOptions"/> containing initial, default values for the operation. /// </param> /// <returns> /// A <see cref="ExtractInterfaceOptions"/> reference encapsulating the dialog's parameters. /// </returns> public ExtractInterfaceOptions ShowDialog(ExtractInterfaceOptions options) { InitializeFields(options); options.IsCancelled = (base.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.Cancel); return options; }