Implementing C# Form in MIP Plugin

So i’m making a plugin that is supposed to render a graph on both Management Client and Smart Client.

While I managed to re-purpose the plugin’s help page in the Management Client to build the graph, I couldn’t quite do the same for the Smart Client.

Is it possible to render a Windows form into the plugin’s tab?

Also, how do I render the Windows Form in Management Client in “plugin Information” tree instead of having to improvise the Help page?

Code snippet from pluginDefinition.cs.

The plugin UI for Smart client is located pluginWorkSpacePlugin.cs.

public override void Init()
        {
            // Populate all relevant lists with your plugins etc.
            _itemNodes.Add(new ItemNode(alpha_topKind, Guid.Empty,
                                         "alpha_top", _treeNodeImage,
                                         "alpha_top", _treeNodeImage,
                                         Category.Text, true,
                                         ItemsAllowed.None,
                                         new alpha_topItemManager(alpha_topKind),
                                         null
                                         ));
            if (EnvironmentManager.Instance.EnvironmentType == EnvironmentType.SmartClient)
            {
                _workSpacePlugins.Add(new alpha_topWorkSpacePlugin());
                /*
                _sidePanelPlugins.Add(new alpha_topSidePanelPlugin());
                _viewItemPlugins.Add(new alpha_topViewItemPlugin());
                _viewItemPlugins.Add(new alpha_topWorkSpaceViewItemPlugin());
                _viewItemToolbarPlugins.Add(new alpha_topViewItemToolbarPlugin());
                _workSpaceToolbarPlugins.Add(new alpha_topWorkSpaceToolbarPlugin());
                _settingsPanelPlugins.Add(new alpha_topSettingsPanelPlugin());
                
            }
            if (EnvironmentManager.Instance.EnvironmentType == EnvironmentType.Administration)
            {
                _tabPlugins.Add(new alpha_topTabPlugin());
                _toolsOptionsDialogPlugins.Add(new alpha_topToolsOptionDialogPlugin());
                */
            }
 
            //_backgroundPlugins.Add(new alpha_topBackgroundPlugin());
 
 
            //Method to render the graph.
            new alpha_topBackgroundProcess();
        }

Try have a look at the Smart Client Workspace sample for an example on how to make your own workspace (tab) with a Windows Forms view item: https://doc.developer.milestonesys.com/html/index.html?base=samples/scworkspace.html&tree=tree_1.html

As to having an item interface with your control in Management Client you should change the ItemsAllowed.None to ItemsAllowed.One in the above code.

In your ItemManager you should change it so that it always reads the same Item from the database, simply ignoring the ID provided in the methods. Also you should overwrite IsContextMenuValid to always return false so that no context menu is available (since you have just the one item that you don’t want anyone to delete).

I’ve tried copying codes from SCWorkspace and using it as template, but even though the code appears to compile properly, it refuses to run for some reason.

https://developer.milestonesys.com/s/question/0D53X00005x3hFTSAY/modifying-scworkspace-to-display-a-control-panel-in-management-client

If you have a look in the Smart Client about box does your plugin then appear in the list of loaded plugins in there?

The plugin is loaded, though I never quite managed to get the Smart Client workspace in the original plugin project.

I’ve managed to get by this problem by modifying SCWorkspace to display the graph in Smart Client, then implementing my original code back to the modified SCWorkspace (which is renamed LiveSystemMonitor).

Then I modified the plugins.def to include this code:

   <load env="SmartClient, Administration"/>

and I’ve managed to get the plugin to display the graph both in Management and Smart Client.

That said, the information box in the Management Client still had my old project’s name despite being renamed, how do I rename that?

It might be that the Management Client has cached the layout. Could you please click View->Reset application layout in the menu and see whether that helps?

It worked… in a way, Now it reads “Configuration”.

Though at least it doesn’t have the old project name anymore.