Ejemplo n.º 1
0
 public void AddComponent(IceCream.Components.IceComponent component)
 {
     component.SetOwner(this);
     if (IsRegistered)
     {
         component.OnRegister();
     }
     _components.Add(component);
 }
Ejemplo n.º 2
0
        public virtual void CopyValuesTo(object target)
        {
            IceComponent component = target as IceComponent;

            component.Enabled = this.Enabled;
        }
 internal static object DeepCopyIceComponent(Type type, IceComponent cloneFrom)
 {
     //Create a new instance of the component
     IceComponent comp = (IceComponent)type.Assembly.CreateInstance(type.FullName);
     //CopyPropertiesTo(comp, cloneFrom);
     cloneFrom.CopyValuesTo(comp);
     return comp;
 }
Ejemplo n.º 4
0
        private void EditSceneItemComponent(IceComponent component)
        {

        }
Ejemplo n.º 5
0
        public void SelectSceneItemComponent(IceComponent component)
        {

            SceneItem item = component.Owner as SceneItem;
            // if the item is not currently selected in the scene editor,
            // select it (after clearing the current selection)
            if (sceneEditorControl.SelectedItems.Contains(item) == false)
            {
                sceneEditorControl.SelectedItems.Clear();
                if (item.IsTemplate == false)
                {
                    sceneEditorControl.SelectedItems.Add(item);
                }
                else
                {
                    sceneEditorControl.PreviewedItem = item;
                }
            }
            menuAddSceneItemComponent.Visible = false;
            labelSceneItemProperties.Text = component.ToString();
            propertyGridSceneItem.SelectedObject = null;
            propertyGridSceneItem.Visible = false;
            genericComponentControl.SelectedComponent = component;
            genericComponentControl.Visible = true;
            _objecToSelect = component;
        }
Ejemplo n.º 6
0
        private IceComponentAttribute GetCustomAttribute(IceComponent comp)
        {
            if (comp.GetType().IsDefined(typeof(IceComponentAttribute), true))
            {
                IceComponentAttribute attrib = (IceComponentAttribute)comp.GetType().GetCustomAttributes(typeof(IceComponentAttribute), true)[0];
                return attrib;

            }
            return null;
        }
Ejemplo n.º 7
0
 private static void WriteSceneComponent(XmlNode sceneComponent, IceComponent comp, XmlDocument doc)
 {
     foreach (var _property in comp.GetType().GetProperties())
     {
         if (_property.GetCustomAttributes(typeof(IceCream.Attributes.IceComponentPropertyAttribute), true).Length > 0)
         {
             sceneComponent.AppendChildIfNotNull(WriteProperty(_property.Name, comp, doc));
         }
     }
 }