public void AddComponent(IceCream.Components.IceComponent component) { component.SetOwner(this); if (IsRegistered) { component.OnRegister(); } _components.Add(component); }
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; }
private void EditSceneItemComponent(IceComponent component) { }
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; }
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; }
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)); } } }