private void enterBTN_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(classTypeTB.Text.Trim())) { MainForm.Instance.ShowMessage("请填写类名", "提示"); return; } if (categoryTB.Text.Trim().Contains(" ")) { MainForm.Instance.ShowMessage("类别不能有空格", "提示"); return; } m_EditNodeDefine.ClassType = classTypeTB.Text.Trim(); m_EditNodeDefine.NodeType = (NodeType)(nodeTypeCBB.SelectedIndex + 1); m_EditNodeDefine.Label = labelTB.Text.Trim(); m_EditNodeDefine.Describe = describeTB.Text.Trim(); m_EditNodeDefine.Category = categoryTB.Text.Trim(); m_EditNodeDefine.CheckField = CBB_CheckField.Checked; m_NodeDefine.NodeIcon = nodeIconCBB.Text; //校验节点类是否合法 VerifyInfo verifyNodeDefine = m_EditNodeDefine.VerifyNodeDefine(); if (verifyNodeDefine.HasError) { MainForm.Instance.ShowMessage(verifyNodeDefine.Msg); return; } string content = XmlUtility.ObjectToString(m_EditNodeDefine); if (m_Content != content) { m_NodeDefine.UpdateNodeDefine(m_EditNodeDefine); MainForm.Instance.ShowInfo("修改成功 时间:" + DateTime.Now); } this.Close(); m_EditCallback?.Invoke(); }
/// <summary> /// 校节点类数据 /// </summary> /// <returns></returns> public VerifyInfo VerifyNodeTemplate() { VerifyInfo verifyClassType = VerifyClassType(); if (verifyClassType.HasError) { return(verifyClassType); } for (int i = 0; i < m_Nodes.Count; i++) { NodeDefine nodeDefine = m_Nodes[i]; VerifyInfo verifyNodeDefine = nodeDefine.VerifyNodeDefine(); if (verifyNodeDefine.HasError) { return(verifyNodeDefine); } } return(VerifyInfo.DefaultVerifyInfo); }
private void enterBTN_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(classTypeTB.Text.Trim())) { MainForm.Instance.ShowMessage("请填写类名", "提示"); return; } if (categoryTB.Text.Trim().Contains(" ")) { MainForm.Instance.ShowMessage("类别不能有空格", "提示"); return; } m_NodeDefine.ClassType = classTypeTB.Text.Trim(); m_NodeDefine.NodeType = (NodeType)(nodeTypeCBB.SelectedIndex + 1); m_NodeDefine.Describe = describeTB.Text.Trim(); m_NodeDefine.Category = categoryTB.Text.Trim(); m_NodeDefine.CheckField = CBB_CheckField.Checked; m_NodeDefine.Label = labelTB.Text.Trim(); m_NodeDefine.NodeIcon = nodeIconCBB.Text; //校验节点类是否合法 VerifyInfo verifyNodeDefine = m_NodeDefine.VerifyNodeDefine(); if (verifyNodeDefine.HasError) { MainForm.Instance.ShowMessage(verifyNodeDefine.Msg); return; } if (!MainForm.Instance.NodeTemplate.AddClass(m_NodeDefine)) { return; } m_NodeTemplateForm.AddNodeDefine(m_NodeDefine); this.Close(); }