protected override void OnComponentRemoved(Core.Component component) { base.OnComponentRemoved(component); if (component is UIElement) { int position = elements.IndexOf(component as UIElement); if (position <= selectedElement) { selectedElement--; } elements.RemoveAt(position); if (selectedElement < 0 && elements.Count > 0) { if (Wrap) { selectedElement = elements.Count - 1; } else { selectedElement = 0; } SelectionChanged(); } } }
protected override void OnComponentAdded(Core.Component component) { if (component is Shape) { throw new Exception("don't add sub-shapes as components to a CompoundShape."); } base.OnComponentAdded(component); }
protected override void OnComponentRemoved(Core.Component component) { base.OnComponentRemoved(component); if (component is ContainerItem) { Contents.Remove(component as ContainerItem); } }
protected override void OnComponentRemoved(Core.Component component) { base.OnComponentRemoved(component); if (component == this.content) { this.content = null; } }
protected override void OnComponentAdded(Core.Component component) { base.OnComponentAdded(component); if (component is ContainerItem) { this.content = component as ContainerItem; this.content.Position = this.Position; } }
/// <summary> /// /// </summary> /// <param name="formid"></param> /// <param name="renderType"></param> /// <returns></returns> public FormField NewField(string formid, RenderType renderType, string attID) { var appform = this.Forms.Where(x => x.Form.FormID == formid).FirstOrDefault(); Core.Component c = new Core.Component(this.ClientID, appform.Form.ComponentID); c.LoadAttributes(); var att = c.Attributes.Where(x => x.FieldID == attID).FirstOrDefault(); var fb = new FormBuilder(appform.Form, new FormFieldBuilder()); var f = fb.NewField(renderType); f.Attribute.FieldAttribute = att; return(f); }
protected override void OnComponentAdded(Core.Component component) { base.OnComponentAdded(component); if (component is ContainerItem) { if (selectedContent < Contents.Count - 1) { Contents.Insert(selectedContent, component as ContainerItem); } else { Contents.Add(component as ContainerItem); selectedContent++; } } }
protected override void OnComponentRemoved(Core.Component component) { base.OnComponentRemoved(component); if (component is InventoryContainerItem) { InventoryContainerItem item = (InventoryContainerItem)component; if (item.InventoryX >= 0 && item.InventoryY >= 0) { for (int y = item.InventoryY; y < item.InventoryY + item.Height; y++) { for (int x = item.InventoryX; x < item.InventoryX + item.Width; x++) { Slots[x, y] = null; } } } } }
protected override void OnComponentAdded(Core.Component component) { base.OnComponentAdded(component); if (component is UIElement) { if (selectedElement < elements.Count - 1) { elements.Insert(selectedElement, component as UIElement); } else { elements.Add(component as UIElement); selectedElement++; } SelectionChanged(); } }
protected override void OnComponentRemoved(Core.Component component) { base.OnComponentRemoved(component); if (component is ContainerItem) { int index = Contents.IndexOf(component as ContainerItem); if (index >= 0) { Contents.RemoveAt(index); if (index <= selectedContent) { selectedContent--; } if (selectedContent < 0 && Contents.Count > 0) { selectedContent = 0; } } } }
public override void OnAdd(Core.Component parent) { base.OnAdd(parent); this.entityLayer = this.Parent as EntityLayer; }
public override void OnAdd(Core.Component parent) { base.OnAdd(parent); this.startzoom = this.Camera.Zoom; this.timer = 0; }
public override void OnAdd(Core.Component parent) { base.OnAdd(parent); this.startzoom = this.Camera.TargetZoom = this.Camera.Zoom; this.transition = 0; }
public override void OnAdd(Core.Component parent) { this.start = (parent as Camera).Position; base.OnAdd(parent); }