public void AddChild(Entity entity) { if (children.Contains(entity)) { return; } children.Add(entity); entity.Parent = this; ChildrenChanged.RaiseAdditionEventEx(this, entity); }
public void Add(View view) { if (view == null) { return; } view.Parent = this; view.Navigation = Parent as NavigationView ?? Parent?.Navigation; _views.Add(view); ChildrenChanged?.Invoke(this, new LayoutEventArgs(_views.Count - 1, 1)); }
public Expression(TextFormatting format = TextFormatting.None) { //BackgroundColor = Color.LightGreen; Orientation = StackOrientation.Horizontal; HorizontalOptions = LayoutOptions.Center; VerticalOptions = LayoutOptions.Center; Spacing = 0; TextFormat = format; ChildAdded += (sender, e) => ChildrenChanged?.Invoke(sender, e, true); ChildRemoved += (sender, e) => ChildrenChanged?.Invoke(sender, e, false); //ChildrenChanged += delegate { CheckPadding(); }; //CheckPadding(); }
public void RemoveChild(Entity entity) { if (!children.Contains(entity)) { return; } children.Remove(entity); entity.Parent = null; // Add the ID property back to the child entity for (int i = entity.Key.Properties.ToList().Count - 1; i >= 0; i--) { if (entity.Properties.Count(p => p == entity.Key.Properties.ElementAt(i)) == 0) { entity.AddProperty(entity.Key.Properties.ElementAt(i)); } } // Add any hidden properties back to the child foreach (var hiddenProperty in entity.PropertiesHiddenByAbstractParent) { hiddenProperty.IsHiddenByAbstractParent = false; } foreach (var hiddenProperty in entity.PropertiesInHiddenKey) { hiddenProperty.IsPartOfHiddenKey = false; } // Add references back between removed child and its parent, which was removed when creating the inheritance structure. if (entity.MappedTables().Count() > 0 && this.MappedTables().Count() > 0 && entity.DirectedReferences.Count(d => d.ToEntity == this) == 0) { var thisTable = this.MappedTables().ElementAt(0); var childTable = entity.MappedTables().ElementAt(0); foreach (Relationship rel in thisTable.Relationships.Where(r => (r.ForeignTable == thisTable && r.PrimaryTable == childTable) || (r.ForeignTable == childTable && r.PrimaryTable == thisTable))) { ArchAngel.Providers.EntityModel.Controller.MappingLayer.MappingProcessor.ProcessRelationshipInternal(entity.EntitySet.MappingSet, rel, new ArchAngel.Providers.EntityModel.Controller.MappingLayer.OneToOneEntityProcessor()); } } ChildrenChanged.RaiseDeletionEventEx(this, entity); }
protected virtual void OnChildrenChanged() { ChildrenChanged?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Raises an event to notify the automation client the the children of the peer have changed. /// </summary> protected void RaiseChildrenChangedEvent() => ChildrenChanged?.Invoke(this, EventArgs.Empty);
protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved) { base.OnVisualChildrenChanged(visualAdded, visualRemoved); ChildrenChanged?.Invoke(); }
protected internal virtual void OnChildrenChanged(SimpleTreeItem simpleTreeItem) { ChildrenChanged?.Invoke(this, new TreeItemEventArgs(simpleTreeItem)); }
private void OnTransformChildrenChanged() { ChildrenChanged?.Invoke(); }