Пример #1
0
        public void LoadAvailableJobs()
        {
            if (AvailableJobs == null)
            {
                AvailableJobs = new ObservableCollection <string>();
            }
            foreach (HWJob job in selectedCharacter.HWModel.HWJobList)
            {
                if (job.Animated.Progress == BaseProgressClass.States.Completed & AvailableJobs.Contains(job.Name))
                {
                    AvailableJobs.Remove(job.Name);
                }
                if (job.Animated.Progress != BaseProgressClass.States.Completed & !AvailableJobs.Contains(job.Name))
                {
                    HWInfo.ReloadJobList(AvailableJobs, job.Name);
                }
            }
            OnPropertyChanged(nameof(AvailableJobs));
            OnPropertyChanged(nameof(RemainingCrystals));

            OnPropertyChanged(nameof(WindCount));
            OnPropertyChanged(nameof(FireCount));
            OnPropertyChanged(nameof(LightningCount));
            OnPropertyChanged(nameof(IceCount));
            OnPropertyChanged(nameof(EarthCount));
            OnPropertyChanged(nameof(WaterCount));
        }
Пример #2
0
        public static HWInfo GetInfo()
        {
            HWInfo       HW     = default(HWInfo);
            Action <int> Method = UpdateProgress;
            ComputerInfo Memory = new ComputerInfo();

            Loading.Bar.Invoke(Method, 0);
            HW.Cores = Environment.ProcessorCount;
            Loading.Bar.Invoke(Method, 17);
            HW.Memory = Memory.TotalPhysicalMemory;
            Loading.Bar.Invoke(Method, 34);

            using (ManagementObjectSearcher Info = new ManagementObjectSearcher("SELECT * FROM Win32_Processor")) {
                foreach (ManagementObject Obj in Info.Get())
                {
                    HW.Processor = Obj["Name"].ToString();
                    Loading.Bar.Invoke(Method, 51);
                    HW.DataWidth = Obj["DataWidth"].ToString();
                    Loading.Bar.Invoke(Method, 68);
                    HW.L2 = int.Parse(Obj["L2CacheSize"].ToString());
                    Loading.Bar.Invoke(Method, 85);
                    HW.L3 = int.Parse(Obj["L3CacheSize"].ToString());
                    Loading.Bar.Invoke(Method, 100);
                }
            }

            return(HW);
        }
        private void CompleteCommand()
        {
            HWJob tempJob = selectedCharacter.HWModel.HWJobList[HWInfo.JobListString.IndexOf(SelectedJob)];

            HWInfo.ProgressClass(selectedCharacter, tempJob.Awoken, true);

            LoadAvailableJobs();
        }
Пример #4
0
        private void HWCommand(object param)
        {
            //HWProgress values = (HWProgress)param;

            //HWJob tempJob = (HWJob)values[0];
            HWProgress tempProgress = (HWProgress)param;

            HWInfo.ProgressClass(selectedCharacter, tempProgress);
        }
Пример #5
0
    public static PERFORMANCE_ENUM GetPerformanceType()
    {
        int   height    = Screen.height;
        uint  cpuCount  = HWInfo.getCpuCoreNumber();
        long  ram       = long.Parse(PhoneInfo.getTotalMemory()) / 1024 / 1024;
        float frequency = (float)HWInfo.getCpuMaxFre() / 1024 / 1024;

        Log.info("height : " + height);
        Log.info("cpuCount : " + cpuCount);
        Log.info("ram : " + ram);
        Log.info("frequency : " + frequency);

        if (ram >= 2500)
        {
            // 大于3g全部为中
            return(PERFORMANCE_ENUM.MIDDLE);
        }
        else
        if (ram < 1600)
        {
            // 小于2G 全部为低
            return(PERFORMANCE_ENUM.LOW);
        }

        if (cpuCount > 4)
        {
            // 4核以上为中
            return(PERFORMANCE_ENUM.MIDDLE);
        }

        // 获取硬件信息
        string hardware = PhoneInfo.getHardware();

        Log.info("hardware : " + hardware);
        foreach (string member in lowCpuSet)
        {
            if (hardware.ToLower().StartsWith(member))
            {
                // 指定低端cpu的,全部为低
                return(PERFORMANCE_ENUM.LOW);
            }
        }

        // 其他为中
        return(PERFORMANCE_ENUM.MIDDLE);
    }
 public void LoadAvailableJobs()
 {
     if (AvailableJobs == null)
     {
         AvailableJobs = new ObservableCollection <string>();
     }
     foreach (HWJob job in selectedCharacter.HWModel.HWJobList)
     {
         if (job.Awoken.Progress == BaseProgressClass.States.Completed & AvailableJobs.Contains(job.Name))
         {
             AvailableJobs.Remove(job.Name);
         }
         if (job.Awoken.Progress != BaseProgressClass.States.Completed & !AvailableJobs.Contains(job.Name))
         {
             HWInfo.ReloadJobList(AvailableJobs, job.Name);
         }
     }
     OnPropertyChanged(nameof(AvailableJobs));
 }