/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FigureSettingClick(object sender, EventArgs e) { // Get setting PPathwayObject obj = (PPathwayObject)m_con.Canvas.FocusNode; ComponentSetting cs = obj.Setting.Clone(); cs.Name = m_con.ComponentManager.GetRandomKey(); cs.IsDefault = false; // Show Setting Dialog. ComponentDialog dlg = new ComponentDialog(m_con.ComponentManager); using (dlg) { dlg.IsPathway = true; dlg.Setting = cs; if (dlg.ShowDialog() != DialogResult.OK) return; dlg.ApplyChange(); cs = dlg.Setting; cs.IsStencil = false; m_con.ComponentManager.RegisterSetting(cs); m_con.SetNodeIcons(); // Register new stencil if (dlg.DoesRegister) { m_con.Stencil.AddStencil(cs); } } // Update. List<PPathwayObject> list = new List<PPathwayObject>(); foreach (PPathwayObject pObj in m_con.Canvas.SelectedNodes) { if (!pObj.Setting.Type.Equals(cs.Type)) continue; pObj.Setting = cs; list.Add(pObj); } m_con.NotifyDataChanged(list); }
private void propertyToolStripMenuItem_Click(object sender, System.EventArgs e) { if (m_stencil == null) return; // Show Setting Dialog. ComponentDialog dlg = new ComponentDialog(m_con.ComponentManager); dlg.Setting = m_stencil.Setting; using (dlg) { if (dlg.ShowDialog() != DialogResult.OK) return; dlg.ApplyChange(); m_con.SetNodeIcons(); } }