/// <summary>
        /// Constructor that takes an initial capacity 
        /// </summary>
        public PrioritizedHeuristicsManager()
        {
            _ssmeStateInfoList = new List<SSMEStateInfo>();
            _timer = new DispatcherTimer();
            // poll every second so we can average FPS
            _timer.Interval = new TimeSpan(0, 0, 1);
            _timer.Tick += Dispatcher_Tick;

            _clearReEnableTimer = new DispatcherTimer();
            _clearReEnableTimer.Interval = TimeSpan.FromMinutes(2);
            _clearReEnableTimer.Tick += _clearReEnableTimer_Tick;

            // instance our Analytics class
            // we must do this in a try / catch block because
            // this can throw on some machines because of 
            // a windows bug
            try
            {
                _analytics = new Analytics();
            }
            catch (Exception) //TODO: what is the specific exception to catch here?
            {
                // do nothing
            }
        }
示例#2
0
		public App()
		{
			Analytics = new Analytics();
			base.Startup += Application_Startup;
			//base.Startup += new WeakEventHandler<StartupEventHandler, StartupEventArgs>(Application_Startup, null/*e => base.Startup -= e*/);
			base.Exit += Application_Exit;
			base.UnhandledException += Application_UnhandledException;
			base.CheckAndDownloadUpdateCompleted += Application_UpdateCompleted;
			InitializeComponent();

			base.CheckAndDownloadUpdateAsync();
		}
        void Feedback_Loaded(object sender, RoutedEventArgs e)
        {
            _baseUrl = _baseUrl.Replace("{0}", HtmlPage.Document.DocumentUri.Host);

            //_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´¯`.¸_¸.·´
            // Collect system info
            StringBuilder sbStringBuilder = new StringBuilder();

            sbStringBuilder.AppendLine("OSVersion: " + Environment.OSVersion);
            sbStringBuilder.AppendLine("System start: " + Environment.TickCount.ConvertToNiceTime());
            sbStringBuilder.AppendLine("CLR Version: " + Environment.Version);

            sbStringBuilder.AppendLine("Host.Source: " + Application.Current.Host.Source);

            if (HtmlPage.Document != null && HtmlPage.Document.DocumentUri != null)
            {
                sbStringBuilder.AppendLine("Host: " + HtmlPage.Document.DocumentUri.Host);
                sbStringBuilder.AppendLine("Host.Port: " + HtmlPage.Document.DocumentUri.Port);
            }

            if (HtmlPage.BrowserInformation != null)
            {
                sbStringBuilder.AppendLine("BrowserInformation.Name: " + HtmlPage.BrowserInformation.Name);
                sbStringBuilder.AppendLine("BrowserInformation.BrowserVersion: " + HtmlPage.BrowserInformation.BrowserVersion);
                sbStringBuilder.AppendLine("BrowserInformation.Platform: " + HtmlPage.BrowserInformation.Platform);

                sbStringBuilder.AppendLine("BrowserInformation.ProductName: " + HtmlPage.BrowserInformation.ProductName);
                sbStringBuilder.AppendLine("BrowserInformation.ProductVersion: " + HtmlPage.BrowserInformation.ProductVersion);
                sbStringBuilder.AppendLine("BrowserInformation.UserAgent: " + HtmlPage.BrowserInformation.UserAgent);

                sbStringBuilder.AppendLine("BrowserInformation.CookiesEnabled: " + HtmlPage.BrowserInformation.CookiesEnabled);
            }

            //sbStringBuilder.AppendLine("IsRunningOutOfBrowser: " + System.Windows.Application.Current.IsRunningOutOfBrowser);
            //sbStringBuilder.AppendLine("RootVisual.Clip.Bounds.Width: " + System.Windows.Application.Current.RootVisual.Clip.Bounds.Width);
            //sbStringBuilder.AppendLine("RootVisual.Clip.Bounds.Height: " + System.Windows.Application.Current.RootVisual.Clip.Bounds.Height);

            sbStringBuilder.AppendLine("Windowless: " + Application.Current.Host.Settings.Windowless);
            sbStringBuilder.AppendLine("MaxFrameRate: " + Application.Current.Host.Settings.MaxFrameRate);

            //System.Windows.Analytics
            Analytics analytics = new Analytics();
            sbStringBuilder.AppendLine("AverageProcessLoad: " + analytics.AverageProcessLoad);
            sbStringBuilder.AppendLine("AverageProcessorLoad: " + analytics.AverageProcessorLoad);
            sbStringBuilder.AppendLine("GpuCollection.Count: " + analytics.GpuCollection.Count);
            foreach (var singleGpu in analytics.GpuCollection)
            {
                sbStringBuilder.AppendLine(
                    string.Format(" ID:{0}, {1}, {2} ", singleGpu.DeviceId, singleGpu.DriverVersion, singleGpu.VendorId));
            }

            textBlockSysInfo.Text = AdditionalInfo + Environment.NewLine + sbStringBuilder;
        }