public EnumColumn(string guid, IProject proj, EnumEntity entity) : base(guid) { this._proj = proj; this._entity = entity; this.DataState = DataState.Add; this.IsChanged = true; }
public EnumColumn(EnumEntity entity, EnumColumn col) : base(col.Guid) { this._proj = col.Proj; this._entity = entity; this.Code = col.Code; this.Name = col.Name; this.EnumValue = col.EnumValue; }
public EnumEntity(EnumEntity entity) : base(entity.Guid) { this.Code = entity.Code; this.Name = entity.Name; this._proj = entity.Proj; this._columnList.Clear(); foreach (EnumColumn col in entity.ColumnList) { EnumColumn enumCol = new EnumColumn(this, col); this._columnList.Add(enumCol); } }
/// <summary> /// 新增枚举 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsm_AddEnum_Click(object sender, EventArgs e) { if (this._currentProjNode == null) { MessageBox.Show("请选择一个工程"); } else { ComponentTreeNode tn = new ComponentTreeNode(NodeType.EnumEntity, Guid.NewGuid().ToString()); tn.Text = "新增Enum"; tn.ImageIndex = tn.SelectedImageIndex = 9; EnumEntity entity = new EnumEntity(this._currentProj, tn.Guid, string.Empty); if (this._bindDataNode.NodeType == NodeType.Floder) { entity.FloderGuid = this._bindDataNode.Guid; } entity.Code = string.Empty; entity.Name = tbDisplayName.Text; if (this._bindDataNode.NodeType == NodeType.Floder) { entity.FloderGuid = this._bindDataNode.Guid; } this._currentProj.EnumList.Add(entity); this._bindDataNode.Nodes.Add(tn); this.tvProject.SelectedNode = tn; } }
public override void FromXML(XmlNode node) { this.DataState = DataState.UnChanged; this.Namespace = node.Attributes["namespace"].Value; this._guid = node.Attributes["Guid"].Value; this.ProjName = node.Attributes["Name"].Value; this.IsService = false; if (node.Attributes["SVC"] != null) { this.IsService = (node.Attributes["SVC"].Value == "1" ? true : false); } this.DataState = DataState.Update; this.EntityList.Clear(); this.FloderList.Clear(); this.DTOList.Clear(); this.EnumList.Clear(); this.RefrenceList.Clear(); XmlNodeList nodeList = node.SelectNodes("RefrenceList/Refrence"); if (nodeList != null) { foreach (XmlNode n in nodeList) { ProjectRefrence projRef = new ProjectRefrence(this, string.Empty, string.Empty); projRef.FromXML(n); this.RefrenceList.Add(projRef); } } nodeList = node.SelectNodes("BPList/BP"); //查找当前工程文件下所有的实体 if (nodeList != null) { foreach (XmlNode n in nodeList) { BPEntity entity = new BPEntity(this, string.Empty, string.Empty); entity.FromXML(n); this.EntityList.Add(entity); } } this.FloderList.AddRange(this.LoadFloderList(node)); nodeList = node.SelectNodes("DTOList/DTO"); if (nodeList != null) { foreach (XmlNode n in nodeList) { DTOEntity dtoEntity = new DTOEntity(this, string.Empty, string.Empty); dtoEntity.FromXML(n); this.DTOList.Add(dtoEntity); } } nodeList = node.SelectNodes("EnumList/Enum"); if (nodeList != null) { foreach (XmlNode n in nodeList) { EnumEntity enumEntity = new EnumEntity(this, string.Empty, string.Empty); enumEntity.FromXML(n); this.EnumList.Add(enumEntity); } } this.IsChanged = false; }
public BuildEnumEntity(EnumEntity entity) { _entity = entity; _namespace = entity.Proj.Namespace; }
public BuildEnumDTOEntity(EnumEntity entity) { _entity = entity; _namespace = entity.Proj.Namespace + "." + DTOEntity.AssemblyEndTag; }