private void Start()
 {
     _player  = GameObject.Find("player").transform;
     offset   = _player.position;
     startPos = this.transform.position;
     _info    = transform.parent.GetComponent <InfoGetter>();
 }
Example #2
0
    private void Awake()
    {
        closeResultsButton.onClick.AddListener(OnResultsPageClose);

        saveManager        = gameObject.GetComponent <SaveManager>();
        loadManager        = gameObject.GetComponent <LoadManager>();
        infoManager        = gameObject.GetComponent <InfoManager>();
        sessionXPManager   = gameObject.GetComponent <SessionXPManager>();
        storeManager       = gameObject.GetComponent <StoreManager>();
        infoGetter         = gameObject.GetComponent <InfoGetter>();
        achievementManager = gameObject.GetComponent <AchievementManager>();
    }
        private void worker_QueryInfo(object sender, DoWorkEventArgs e)
        {
            try {
                Ping      ping      = new Ping();
                PingReply pingReply = null;

                try {
                    pingReply = ping.Send((string)e.Argument, 1000);
                }
                catch (PingException pingException) {
                    Console.WriteLine("Error! Bad hostname: " + (string)e.Argument + ". Skipping...");
                    ping.Dispose();
                    return;
                }

                if (pingReply.Status != IPStatus.Success)
                {
                    ping.Dispose();
                    return;
                }
                ping.Dispose();

                InfoGetter infoGetter = new InfoGetter();
                infoGetter.USBIDSPath = globalArgs.usbIDSPath;
                if (!infoGetter.connectionTest((string)e.Argument))
                {
                    Console.WriteLine("WMI/CIM query failed on " + (string)e.Argument + ". Skipping...");
                    return;
                }

                if (!infoGetter.registryTest((string)e.Argument))
                {
                    Console.WriteLine("Registry query failed on " + (string)e.Argument + ". Skipping...");
                    return;
                }

                string computer = (string)e.Argument;

                ComputerInfo       computerInfo = infoGetter.GetComputerInfo(computer);
                List <MonitorInfo> monitorInfos = infoGetter.GetMonitorInfo(computer);
                monitorInfos = infoGetter.FilterMonitorInfo(monitorInfos, globalArgs);
                List <DeviceInfo> deviceInfos = infoGetter.GetDeviceInfoRegistry(computer);
                deviceInfos = infoGetter.FilterDeviceInfo(deviceInfos, globalArgs);

                List <CSVInfo> returnInfo = writer.IngestData(computerInfo, monitorInfos, deviceInfos);
                e.Result = returnInfo;
            }
            catch {
                Console.WriteLine("Unknown unhandled error querying " + e.Argument + ". Aborting...");
                e.Result = null;
            }
        }
Example #4
0
 public ProfilesControlHandler(string profileType, MainForm mainForm, ProfileControl p,
                               SettingsEditor <TSettings, TInfo> editor,
                               InfoGetter <TInfo> g2,
                               SettingsGetter <TSettings> getter,
                               SettingsSetter <TSettings> setter)
 {
     this.profileType        = profileType;
     this.SetCurrentSettings = setter;
     this.GetCurrentSettings = getter;
     this.EditSettings       = editor;
     this.GetInfo            = g2;
     this.mainForm           = mainForm;
     p.ProfileIndexChanged  += new EventHandler(avsProfile_SelectedIndexChanged);
     p.ConfigClick          += new EventHandler(avsConfigButton_Click);
     impl = p;
     RefreshProfiles();
 }