Menu

Form node settings

2007-03-27
2013-04-24
  • Vincent AROD

    Vincent AROD - 2007-03-27

    Hi !!

    I'm a beginner with mmclibrary and i have some troubbles to understand how settings value in my usercontrol using form node.

    In my snap-in base, i'm using a wizard in order to know on with server i'm connected.

    In my form node, i need to get the value of the wizard (a string field). I succeed in getting it but then I don't know how to instance my usercontrol or accessing to its instance ...

    ******* In mysnapinbase.cs ********************************     
    protected override void ShowInitialisationWizard()
    {
         wsm = new WzdSnapinManager();
         wsm.Validated += new EventHandler(wsm_Validated);
         WizardBase.ShowWizard("Startup Snapin Manager Wizard", new WizardPage[] {wsm}, new WizardBase.WizardAction(ManagerHandler));
               
    }

    void wsm_Validated(object sender, EventArgs e)
    {
         LoadSiteServerInfo();
    }

    void LoadSiteServerInfo()
    {
         m_SiteServer = new SiteServer(wsm.strSiteServer);
         rootNode.AddChild(new FormNodes.SettingsForm(this, "Server settings", "MyMMC.security.ico", "MyMMC.security.ico",m_SiteServer));
    }
    ************************************************************

    *********************In settingsForm.cs************************

    public SettingsForm(SnapinBase snapin, String displayName, String closedIco, String openIco,PSCommon.SiteServer _siteserver)
                : base(snapin, displayName, typeof(MyMMC.Controls.ucServerSettings), closedIco, openIco)
            {

                //Something to do in order to access to my usercontrol Element or function ?
            }
    ***************************************************************

    Thanks in advance !!

    Vincent.

     
    • tigerharry

      tigerharry - 2007-03-28

      Hi,
      I use application settings (.Net2.0) in my mmc snapin. So I can access them as singelton by using Settings.Default.XXX.
      I've not been using a wizard yet but changing settings in Snapinbase and using these in my controls works with fine application settings.
      I'm using MMCLib2.0. (Depending on bindings of the settings you may need to "invoke" changings because the snapin run as a different thread as your controls)

      Greetings,

      Harry

       
    • Vincent AROD

      Vincent AROD - 2007-03-28

      Hi Harry,

      That's a great idea and it works perfectly !

      Thanks a lot!

      Vincent.

       

Log in to post a comment.