Пример #1
0
 public void InitNetworkManager()
 {
     if(!MainClass.boRoot)
     {
         BTN_Network.Visible=false;
         LIB_Root.Visible=true;
     }
     else
     {
         LIB_Root.Visible=false;
     }
     //network init
     EnableDisable(INT_WICD,"wicd",LIB_WICDNotInstalled);
     EnableDisable(INT_NM,"networkmanager",LIB_NMNotInstalled);
     Service nm = new Service("NetworkManager");
     INT_NM.Active=nm.IsStartedOnBoot();
     Service wicd = new Service("wicd");
     INT_WICD.Active=wicd.IsStartedOnBoot();
     if(!INT_WICD.Active && !INT_NM.Active)
         INT_FW.Active=true;
 }
Пример #2
0
        protected void OnSelectionEntryService(object o, EventArgs args)
        {
            try
            {

             	TreeModel model;
                 if (((TreeSelection)o).GetSelected(out model, out iter))
                {
                    string T =(string)model.GetValue (iter, 0);
                    ServiceSelected=T;

                    BTN_ServiceStop.Visible=false;
                    BTN_ServiceStart.Visible=false;
                    BTN_ServiceDelBoot.Visible=false;
                    BTN_ServiceAddBoot.Visible=false;
                    Service service = new Service(T);
                    if (service.IsStarted())
                        BTN_ServiceStop.Visible=true;
                    else
                        BTN_ServiceStart.Visible=true;
                    if(service.IsStartedOnBoot())
                        BTN_ServiceDelBoot.Visible=true;
                    else
                        BTN_ServiceAddBoot.Visible=true;

                }
            }
            catch{}
        }