/// <summary> /// コンストラクタ /// </summary> /// <param name="main"><see cref="MainEdittor"/></param>への参照 /// <exception cref="ArgumentNullException"><paramref name="main"/>がnull</exception> private ElementWindow(MainEdittor main) { mainEdittor = main ?? throw new ArgumentNullException(); SingleInstance = this; InitializeComponent(); ResetObjComboBox(); ResetAdditionalComboBox(); ComboBox_Obj_Type.DataSource = EnumHelper.GetNames <UITypes>(); ComboBox_Add_Type.DataSource = EnumHelper.GetNames <DrawingAdditionalMode>(); }
/// <summary> /// インスタンスを生成して表示する /// </summary> /// <param name="main">メインのエディターへの参照</param> /// <exception cref="ArgumentNullException"><paramref name="main"/>がnull</exception> public static bool CreateAndShow(MainEdittor main) { if (!Instanced) { var a = new ElementWindow(main); DataBase.Forms.Add(a); a.Show(); return(true); } return(false); }
/// <summary> /// フォームが閉じられたときの挙動 /// </summary> private void AddWindow_FormClosed(object sender, FormClosedEventArgs e) { SingleInstance = null; DataBase.Forms.Remove(this); }
/// <summary> /// <see cref="要素を追加削除するToolStripMenuItem"/>クリック時の挙動 /// </summary> private void 要素を追加削除するToolStripMenuItem_Click(object sender, EventArgs e) => ElementWindow.CreateAndShow(this);