Esempio n. 1
0
        public List <OS> GetOSFromCache()
        {
            OSManager osManager = new OSManager();
            var       result    = osManager.List();

            return(result);
        }
Esempio n. 2
0
        static void TestGetLastBootDateTime(string serverName)
        {
            try
            {
                Console.WriteLine("");
                Console.WriteLine("=== Get Last Boot Date -> Iniciando  ===");
                Console.WriteLine("");

                // Required parameters
                FontFamily      fontFamily = new FontFamily("Arial");
                Font            font       = new Font(fontFamily, 16, FontStyle.Regular, GraphicsUnit.Pixel);
                DataGridViewRow drRow      = new DataGridViewRow();

                OSManager osMgr        = new OSManager(font, ConfigurationFileHelper.RemoteOperationsUsesDCOM);
                DateTime  lastBootDate = osMgr.GetLastBootDateTimeObject(serverName, ref drRow);

                Console.WriteLine("Last boot date: {0}", lastBootDate.ToString("dd/MM/yyyy HH:mm:ss"));
            }
            catch (Exception ex)
            {
                Console.WriteLine("Erro: {0}", ex.Message);
            }
            finally
            {
                Console.WriteLine("");
                Console.WriteLine("=== Get Last Boot Date -> Concluido ===");
            }
        }
Esempio n. 3
0
        static void TestRebootServer(string serverName)
        {
            try
            {
                Console.WriteLine("");
                Console.WriteLine("=== Reboot Server -> Iniciando  ===");
                Console.WriteLine("");

                // Required parameters
                FontFamily      fontFamily = new FontFamily("Arial");
                Font            font       = new Font(fontFamily, 16, FontStyle.Regular, GraphicsUnit.Pixel);
                DataGridViewRow drRow      = new DataGridViewRow();

                OSManager osMgr = new OSManager(font, ConfigurationFileHelper.RemoteOperationsUsesDCOM);
                osMgr.StartReboot(serverName, ref drRow);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Erro: {0}", ex.Message);
            }
            finally
            {
                Console.WriteLine("");
                Console.WriteLine("=== Reboot Server -> Concluido ===");
            }
        }
 private void Awake()
 {
     // Do platform specific things in Awake - Ready for other scripts in Start
     if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor)
     {
         osManager = new WindowsOSManager();
     }
     else if (Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.OSXEditor)
     {
         osManager = new MacOSManager();
     }
 }
Esempio n. 5
0
    private void Update()
    {
        if (Input.GetKeyDown("escape"))
        {
            MasterScript.EnableCAM1();
        }

        //check for object on layer OS
        if (CastRay.Shoot(this.GetComponent <Camera>(), layerMask, range)) //(OPTIMISE LATER: shoot only when mouse moves)
        {
            //if the detected Object has IsOS Component
            if (CastRay.detected.GetComponent <IsOS>() != null)
            {
                //if that OS object is clickable
                if (CastRay.detected.GetComponent <IsOS>().clickable)
                {
                    //CODE HERE WILL RUN IF HOVERING ON CLICKABLE OBJECT
                    OSManager.runHoverFunction();
                    MasterScript.EnableCrosshairAll();
                    MasterScript.toast(CastRay.detected.GetComponent <IsOS>().text);
                    if (Input.GetMouseButtonDown(0)) //if clicked on the clickable object
                    {
                        OSManager.runClickFunction();
                    }
                }
                else //if the object has IsOS component but isn't clickable
                {
                    MasterScript.DisableCrosshairDark();
                    MasterScript.HideSubText();
                    DesktopManager.disableAllBlack();
                }
            }
            else //if detected object doesn't have a IsOS component
            {
                MasterScript.inactive();
                DesktopManager.disableAllBlack();
                if (Input.GetMouseButtonDown(0))
                {
                    LoginManager.inputDeselected();
                }
            }
        }
        else //if no object detected by ray
        {
            MasterScript.inactive();
            DesktopManager.disableAllBlack();
        }
    } //update close