Harness proD API Help
EPLAN.Harness.API.Plugins.Core Namespace / IHpDPluginInfo Interface / ModuleChanged Method
A module which is currently being changed on.
Example
In This Topic
    ModuleChanged Method
    In This Topic
    If a module (Workspace, ProjectPage, Report, etc.) changes, ModuleChanged method is called informing user about the chagne.
    Syntax
    void ModuleChanged( 
       HpDModule hpdModule
    )

    Parameters

    hpdModule
    A module which is currently being changed on.
    Remarks
    The method can be used to react on module changed and thus for example change plugin button visibility or other properties.
    Example
    INotifyPropertyChanged interface must be implemented in order to report changes to HpD.
    The example shows now to change plugin button visibility based on module change.
    public HpDModule EnabledInModule => HpDModule.Studio;
    private bool _visible = true;
    
    public bool Visible
    {
    	get => _visible;
    	set
    	{
    		_visible = value;
    		NotifyPropertyChanged(nameof(Visible));
    	}
    }
    
    public void ModuleChanged(HpDModule api)
    {
    	Enabled = EnabledInModule.HasFlag(api);
    }
    
    private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
    {
    	PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
    See Also