Esempio n. 1
0
        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();
                }
            }
        }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 protected override void OnComponentRemoved(Core.Component component)
 {
     base.OnComponentRemoved(component);
     if (component is ContainerItem)
     {
         Contents.Remove(component as ContainerItem);
     }
 }
Esempio n. 4
0
        protected override void OnComponentRemoved(Core.Component component)
        {
            base.OnComponentRemoved(component);

            if (component == this.content)
            {
                this.content = null;
            }
        }
Esempio n. 5
0
 protected override void OnComponentAdded(Core.Component component)
 {
     base.OnComponentAdded(component);
     if (component is ContainerItem)
     {
         this.content          = component as ContainerItem;
         this.content.Position = this.Position;
     }
 }
Esempio n. 6
0
        /// <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);
        }
Esempio n. 7
0
 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++;
         }
     }
 }
Esempio n. 8
0
 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;
                 }
             }
         }
     }
 }
Esempio n. 9
0
        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();
            }
        }
Esempio n. 10
0
 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;
             }
         }
     }
 }
Esempio n. 11
0
 public override void OnAdd(Core.Component parent)
 {
     base.OnAdd(parent);
     this.entityLayer = this.Parent as EntityLayer;
 }
Esempio n. 12
0
 public override void OnAdd(Core.Component parent)
 {
     base.OnAdd(parent);
     this.startzoom = this.Camera.Zoom;
     this.timer     = 0;
 }
Esempio n. 13
0
 public override void OnAdd(Core.Component parent)
 {
     base.OnAdd(parent);
     this.startzoom  = this.Camera.TargetZoom = this.Camera.Zoom;
     this.transition = 0;
 }
Esempio n. 14
0
 public override void OnAdd(Core.Component parent)
 {
     this.start = (parent as Camera).Position;
     base.OnAdd(parent);
 }