/// <summary> /// Creates a new instance of the <see cref="Layer" /> class based on the provided layer entity /// </summary> /// <param name="profile">The profile the layer belongs to</param> /// <param name="parent">The parent of the layer</param> /// <param name="layerEntity">The entity of the layer</param> public Layer(Profile profile, ProfileElement parent, LayerEntity layerEntity) : base(parent.Profile) { LayerEntity = layerEntity; EntityId = layerEntity.Id; Profile = profile; Parent = parent; _general = new LayerGeneralProperties(); _transform = new LayerTransformProperties(); _leds = new List <ArtemisLed>(); Load(); Initialize(); }
internal Layer(Profile profile, ProfileElement parent, LayerEntity layerEntity) { LayerEntity = layerEntity; Profile = profile; Parent = parent; General = new LayerGeneralProperties(); Transform = new LayerTransformProperties(); _layerEffects = new List <BaseLayerEffect>(); _leds = new List <ArtemisLed>(); _expandedPropertyGroups = new List <string>(); Load(); Initialize(); }
/// <summary> /// Creates a new instance of the <see cref="Layer" /> class and adds itself to the child collection of the provided /// <paramref name="parent" /> /// </summary> /// <param name="parent">The parent of the layer</param> /// <param name="name">The name of the layer</param> public Layer(ProfileElement parent, string name) : base(parent.Profile) { LayerEntity = new LayerEntity(); EntityId = Guid.NewGuid(); Parent = parent ?? throw new ArgumentNullException(nameof(parent)); Profile = Parent.Profile; Name = name; Enabled = true; _general = new LayerGeneralProperties(); _transform = new LayerTransformProperties(); _leds = new List <ArtemisLed>(); Initialize(); Parent.AddChild(this, 0); }
/// <summary> /// Creates a new instance of the <see cref="Layer" /> class and adds itself to the child collection of the provided /// <paramref name="parent" /> /// </summary> /// <param name="parent">The parent of the layer</param> /// <param name="name">The name of the layer</param> public Layer(ProfileElement parent, string name) { LayerEntity = new LayerEntity(); EntityId = Guid.NewGuid(); Parent = parent ?? throw new ArgumentNullException(nameof(parent)); Profile = Parent.Profile; Name = name; Enabled = true; DisplayContinuously = true; General = new LayerGeneralProperties(); Transform = new LayerTransformProperties(); _layerEffects = new List <BaseLayerEffect>(); _leds = new List <ArtemisLed>(); _expandedPropertyGroups = new List <string>(); Initialize(); ApplyRenderElementDefaults(); Parent.AddChild(this); }