GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoObject Class / OnLayerChanged Method
This GoLayer value is the old value of Layer. The value will be null if the object did not belong to a layer but is being added to one.
This GoLayer value is the new value of Layer. The value will be null if the object is being removed from a layer.
This is the object that is being inserted or removed from a layer.
In This Topic
    OnLayerChanged Method (GoObject)
    In This Topic
    Called when this object's layer is changed.
    Syntax
    protected virtual void OnLayerChanged( 
       GoLayer oldlayer,
       GoLayer newlayer,
       GoObject mainObj
    )

    Parameters

    oldlayer
    This GoLayer value is the old value of Layer. The value will be null if the object did not belong to a layer but is being added to one.
    newlayer
    This GoLayer value is the new value of Layer. The value will be null if the object is being removed from a layer.
    mainObj
    This is the object that is being inserted or removed from a layer.
    Remarks
    When this object is being removed from its layer, this method is called before the actual value of Layer is set to null. Otherwise this method is called after the layer has been changed. Both oldlayer and newlayer can be non-null when the object is being moved from one layer to another. Unlike GoDocument.Changed events, this method will be called even when this object is not part of a document, or when SuspendsUpdates is true. However, this method is not called upon undo or redo of a change of layer. By default this method does nothing. Any implementation of this method should not cause a change in layers.
    See Also