/// <summary> /// /// </summary> /// <param name="entity"></param> private void refreshEntity(Kernel.Domain.Entity entity) { entity.model = this.EditedObject; entity.RefreshAttributeEntity(); this.diagramEditor.designerCanvas.RefreshEntity(entity); foreach (Kernel.Domain.Entity child in entity.childrenListChangeHandler.Items) { child.parent = entity; refreshEntity(child); } }
/// <summary> /// Cette methode est appelée lorsau'on a supprimé un lien entre deaux blocks /// </summary> /// <param name="parent"></param> /// <param name="child"></param> protected void onDeleteLink(DesignerItem parent, DesignerItem child) { if (parent.Tag == null || child.Tag == null) { return; } Kernel.Domain.Entity parentTag = (Kernel.Domain.Entity)parent.Tag; Kernel.Domain.Entity childTag = (Kernel.Domain.Entity)child.Tag; parentTag.ForgetChild(childTag); childTag.parent = null; this.EditedObject.UpdateEntity(childTag); this.IsModify = true; }
/// <summary> /// Display entity attributes. /// Builds the root node and calls DisplayRoot() /// </summary> /// <param name="entity"> Entity to display </param> public void DisplayEntity(Kernel.Domain.Entity entity) { this.Entity = entity; if (entity != null) { Kernel.Domain.Attribute root = new Kernel.Domain.Attribute(); root.childrenListChangeHandler = entity.attributeListChangeHandler; //root.entity = entity; this.DisplayRoot(root); } else { this.DisplayRoot(null); } }
public void setEntity(Kernel.Domain.Entity entity) { if (ActiveItem == null) { return; } if (reconciliationContext == null) { reconciliationContext = new Kernel.Domain.ReconciliationContext(); } if (ActiveItem == recoTypeEntityPanel) { reconciliationContext.recoTypeEntity = entity; this.ActiveItem.setValue(entity); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void onModifyBlock(DesignerItem sender) { if (this.EditedObject != null && sender.Tag != null) { Kernel.Domain.Entity entity = (Kernel.Domain.Entity)sender.Tag; if (entity.parent != null) { entity.parent.UpdateChild(entity); } else { this.EditedObject.UpdateEntity(entity); } this.IsModify = true; } }
/// <summary> /// Cette methode est appelée lorsau'on a ajouté un lien entre deaux blocks /// </summary> /// <param name="parent"></param> /// <param name="child"></param> protected void onAddLink(DesignerItem parent, DesignerItem child) { if (parent.Tag == null || child.Tag == null) { return; } Kernel.Domain.Entity parentTag = (Kernel.Domain.Entity)parent.Tag; Kernel.Domain.Entity childTag = (Kernel.Domain.Entity)child.Tag; if (parentTag.isValueChain || childTag.isValueChain) { return; } this.EditedObject.ForgetEntity(childTag); parentTag.AddChild(childTag); this.IsModify = true; }
/// <summary> /// Cette méthode est exécuté lorqu'un objet ou une Vc est sélectionné dans le diagram. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void onSelectBlok(object sender) { if (sender is DesignerItem) { object tag = ((DesignerItem)sender).Tag; if (tag != null && tag is Kernel.Domain.Entity) { Kernel.Domain.Entity entity = (Kernel.Domain.Entity)tag; if (!entity.isCompleted && entity.oid.HasValue) { entity.attributeListChangeHandler.originalList = ModelService.getRootAttributesByEntity(entity.oid.Value); entity.isCompleted = true; } DisplayEntity(entity); } } }
public void DisplayEntity(Kernel.Domain.Entity entity) { nameTextBox.KeyUp -= nameKeyEventHandler; ActiveEntity = entity; nameTextBox.Clear(); TypeTextBox.Clear(); //attributeValueTree.DisplayAttribute(null); nameTextBox.IsEnabled = false; if (entity != null) { nameTextBox.IsEnabled = true; nameTextBox.Text = entity.name; TypeTextBox.Text = entity.isObject ? "Object" : "ValueChain"; } attributeTreeList.DisplayEntity(entity); attributeTreeList.DisplayEntity(entity); nameTextBox.KeyUp += nameKeyEventHandler; }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void onAddBlock(DesignerItem sender) { if (this.EditedObject != null && sender.Tag != null) { JavaScriptSerializer serial = new JavaScriptSerializer(); Kernel.Domain.Entity entity = null; if (sender.Tag is Kernel.Domain.Entity) { entity = (Kernel.Domain.Entity)sender.Tag; } else if (sender.Tag is string) { entity = serial.Deserialize <Kernel.Domain.Entity>((string)sender.Tag); } else { return; } this.EditedObject.AddEntity(entity); this.IsModify = true; } }
public Misp.Kernel.Domain.Entity getEntityByOid(int oid) { try { var request = new RestRequest(ResourcePath + "/getEntityByOid/", Method.POST); request.RequestFormat = DataFormat.Json; request.AddParameter("application/json", oid, ParameterType.RequestBody); RestResponse queryResult = (RestResponse)RestClient.Execute(request); try { Kernel.Domain.Entity Entity = RestSharp.SimpleJson.DeserializeObject <Kernel.Domain.Entity>(queryResult.Content); return(Entity); } catch (Exception) { return(null); } } catch (Exception e) { throw new BcephalException("Unable to Return targetAll.", e); } }
public void setEntity(Kernel.Domain.Entity entity) { this.ReconciliationContextPanel.setEntity(entity); }