public virtual void InvalidateLayout() { if (!layoutValid) { return; } layoutValid = false; ParentLayer?.InvalidateLayout(); }
// ////////////////////////////// // // Methods // // ////////////////////////////// // /// Associate a new button with this base. If no other buttons have /// previously been associated, make it the default content. public void AddButton(T button) { if (AssociatedButtons.Count == 0) { SetDefault(button); } else { AssociatedButtons[button.ID] = button; } // bubble up the stack ParentLayer.AddButton(button); }
protected override void OnStart() { var scene = new Scene(); var layer = new ParentLayer(); var obj = new DisposingObject(layer); var obj1 = new TextureObject2D(); var obj2 = new TextureObject2D(); var obj3A = new TextureObject2D(); var obj3B = new TextureObject2D(); obj.AddChild(obj1, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position); obj1.AddChild(obj2, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position); obj2.AddChild(obj3A, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position); obj2.AddChild(obj3B, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position); scene.AddLayer(layer); layer.AddObject(obj); Engine.ChangeScene(scene); }
public void Dispose() { GC.SuppressFinalize(this); ParentLayer?.RemoveChild(this); }
public DisposingObject(ParentLayer layer) { this.layer = layer; Texture = Engine.Graphics.CreateTexture2D(CloudTexturePath); }