private void btnGetReflection_Click(object sender, EventArgs e) { // NameSpace if (this.cmbNameSpace.SelectedItem == null) { return; } NameSpaceItem sel = this.cmbNameSpace.SelectedItem as NameSpaceItem; if (sel == null) { return; } Cシャープ日本語化リフレクション.ReflectOtherAssembly.NameSpaceEnum ns = sel.nameSpace; // GetType ReflectOtherAssembly reflect = new ReflectOtherAssemblyVersionDotNet4(); Type type = reflect.GetTypeOfWindowsObject(cmbReflectTarget.Text, ns); if (type == null) { MessageBox.Show("型情報が存在しません。"); return; } // get reflection this.SetFullSignatureIntoReflectionList(type); /* * this.listReflectionList.Items.Clear(); * BindingFlags flag = BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance | BindingFlags.NonPublic; * BindingList<string> dataSource = new BindingList<string>(); * foreach (var item in ReflectionHelper.GetMethodsInfoByBindingFlags(type, flag)) * { * string publicprotected = ReflectionHelper.GetPublicProtected(item); * string isVirtual = ReflectionHelper.GetVirtualIfOverrided(item); * string fullsignature = publicprotected + isVirtual + item.ToString(); * * //this.listReflectionList.Items.Add(publicprotected + isVirtual + item.ToString()); * dataSource.Add(fullsignature); * } */ /* * this.bindingSource4ReflectionList.DataSource = dataSource; * //this.bindingSource4ReflectionList.DataMember = "item"; * this.listReflectionList.DataSource = this.bindingSource4ReflectionList; * this.listReflectionList.DisplayMember = "item"; * var a = this.listReflectionList.DataBindings; * this.bindingSource4ReflectionList.Filter = " like 'O'"; */ }
private void Form1_Load(object sender, EventArgs e) { this.cmbReflectTarget.Load(); this.cmbPrefix.SaveFilename = "prefix.txt"; this.cmbPrefix.Load(); this.cmbPublicElse.SelectedIndex = 0; object selected = new NameSpaceItem(ReflectOtherAssembly.NameSpaceEnum.WindowsForms, "System.Windows.Forms"); this.cmbNameSpace.Items.Add(new NameSpaceItem(ReflectOtherAssembly.NameSpaceEnum.System, "System")); this.cmbNameSpace.Items.Add(new NameSpaceItem(ReflectOtherAssembly.NameSpaceEnum.Generic, "System.Collections.Generic")); this.cmbNameSpace.Items.Add(selected); this.cmbNameSpace.SelectedItem = selected; this.tbxJpLineOfListBox.ParentListView = this.listJpArgsInfo; this.cmbExportMethod.Text = "TSV"; // Menu /* * //Copy * MenuItem mNdoc = new MenuItem(); * mNdoc.Text = "NDocコメント"; * mNdoc.Click += this.ShowNDocCommentDialog; * //this.cMenu.Items.Add(mNdoc); * this.tbxJpMethodName.ContextMenu = new ContextMenu(); * this.tbxJpMethodName.ContextMenu.MenuItems.Add(mNdoc); */ this.AddMenusToControl(this.tbxJpMethodName); this.AddMenusToControl(this.tbxJpReturnType); this.AddMenusToControl(this.listJpArgsInfo); // SIZE using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); int ret = 0; SettingsSingleton.getValue(SettingsSingleton.KeyMainFormTop, out ret); if (ret > 0) { this.Top = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyMainFormLeft, out ret); if (ret > 0) { this.Left = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyMainFormWidth, out ret); if (ret > 0) { this.Width = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyMainFormHeight, out ret); if (ret > 0) { this.Height = ret; } con.CloseConnection(); } }