コード例 #1
0
        // Token: 0x06000189 RID: 393 RVA: 0x000075E0 File Offset: 0x000057E0
        private XmlDocument LoadAsXml(string text)
        {
            XmlDocument xmlDocument = new XmlDocument();

            try
            {
                using (StringReader stringReader = new StringReader(text))
                {
                    using (XmlReader xmlReader = XmlReader.Create(stringReader))
                    {
                        xmlDocument.Load(xmlReader);
                    }
                }
            }
            catch (XmlException value)
            {
                LoggerExtensionMethods.LogError <UpdateChecker>(this, "Error parsing response as XML", new Dictionary <string, object>
                {
                    {
                        "Exception",
                        value
                    }
                }, "LoadAsXml", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Update\\UpdateChecker.cs", 128);
            }
            return(xmlDocument);
        }
コード例 #2
0
 // Token: 0x06000219 RID: 537 RVA: 0x0000A6AC File Offset: 0x000088AC
 private void GoToSettings()
 {
     LoggerExtensionMethods.LogDiagnostic <ImportViewModel>(this, "Video Trimmed", new Dictionary <string, object>
     {
         {
             "StartTime",
             this.StartTime
         },
         {
             "EndTime",
             this.EndTime
         },
         {
             "VideoTotalLength",
             this.project.VideoInfo.Duration
         },
         {
             "TrimmedLength",
             this.project.InputLength
         },
         {
             "RotationAmount",
             this.RotationAmount
         }
     }, "GoToSettings", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\ViewModels\\ImportViewModel.cs", 39);
     base.Navigation.Navigate("Settings", new object[]
     {
         this.project
     });
 }
コード例 #3
0
        // Token: 0x06000175 RID: 373 RVA: 0x00006D90 File Offset: 0x00004F90
        public string GetNewWorkingDirectory()
        {
            string currentScratchDirectory = this.GetCurrentScratchDirectory();
            string text = Path.Combine(currentScratchDirectory, Path.GetRandomFileName());

            Directory.CreateDirectory(text);
            LoggerExtensionMethods.LogDiagnostic <ScratchManager>(this, "New Working Directory", null, "GetNewWorkingDirectory", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Scratch\\ScratchManager.cs", 95);
            return(text);
        }
コード例 #4
0
        // Token: 0x06000176 RID: 374 RVA: 0x00006DD0 File Offset: 0x00004FD0
        public void InitializeScratchSpace()
        {
            string currentScratchDirectory = this.GetCurrentScratchDirectory();
            string path = Path.Combine(currentScratchDirectory, this.SessionIdFileName);

            this.DetectAndHandleUncleanShutdown();
            LoggerExtensionMethods.LogDiagnostic <ScratchManager>(this, "Initalising scratch", null, "InitializeScratchSpace", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Scratch\\ScratchManager.cs", 108);
            Directory.CreateDirectory(currentScratchDirectory);
            using (StreamWriter streamWriter = File.CreateText(path))
            {
                streamWriter.Write(this.telemetryClient.SessionID);
            }
        }
コード例 #5
0
 public static IHostBuilder CreateHostBuilder(string[] args) =>
 Host.CreateDefaultBuilder(args)
 .ConfigureWebHostDefaults(webBuilder =>
 {
     webBuilder.UseStartup <Startup>()
     .ConfigureLogging((hostingContext, config) =>
     {
         config.ClearProviders();
         config.AddSerilog(LoggerExtensionMethods.SerilogInit());
     });
 }).ConfigureAppConfiguration((context, config) =>
 {
     config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
 });
コード例 #6
0
        // Token: 0x06000187 RID: 391 RVA: 0x0000757C File Offset: 0x0000577C
        public async Task <string> CheckForUpgradeAsync(bool overrideDisabledCheck = false)
        {
            string result;

            if (!overrideDisabledCheck && !this.IsUpdateCheckEnabled)
            {
                result = null;
            }
            else
            {
                string installerLink = null;
                try
                {
                    Version devVersion     = Version.Parse("0.0.0.0");
                    Version currentVersion = Assembly.GetEntryAssembly().GetName().Version;
                    if (!(currentVersion == devVersion) && NetworkInterface.GetIsNetworkAvailable())
                    {
                        this.webClient = new WebClient();
                        this.webClient.Headers[HttpRequestHeader.CacheControl] = "no-cache";
                        string text = await this.webClient.DownloadStringTaskAsync(this.VersionLink);

                        XmlDocument xmlDoc      = this.LoadAsXml(text);
                        XmlNode     productNode = xmlDoc.SelectSingleNode(string.Format("/AppInfo/LatestVersion[@Edition='{0}' and @Platform = '{1}']", this.productInfo.Edition, this.productInfo.Platform));
                        XmlNode     versionNode = (productNode != null) ? productNode.SelectSingleNode("VersionNumber") : null;
                        XmlNode     linkNode    = (productNode != null) ? productNode.SelectSingleNode("InstallerLink") : null;
                        Version     v;
                        if (versionNode != null && linkNode != null && Version.TryParse(versionNode.InnerText.Trim(), out v) && currentVersion < v)
                        {
                            installerLink = linkNode.InnerText;
                        }
                    }
                }
                catch (Exception value)
                {
                    LoggerExtensionMethods.LogWarning <UpdateChecker>(this, "Update check failed", new Dictionary <string, object>
                    {
                        {
                            "Exception",
                            value
                        }
                    }, "CheckForUpgradeAsync", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Update\\UpdateChecker.cs", 99);
                }
                this.webClient = null;
                result         = installerLink;
            }
            return(result);
        }
コード例 #7
0
 // Token: 0x0600017B RID: 379 RVA: 0x00007094 File Offset: 0x00005294
 private void CheckDirectoryIsWriteable(string directory)
 {
     try
     {
         string path = Path.Combine(directory, Path.GetRandomFileName());
         File.WriteAllText(path, string.Empty);
         File.Delete(path);
     }
     catch (Exception value)
     {
         LoggerExtensionMethods.LogWarning <ScratchManager>(this, "Coludn't write to scratch directory", new Dictionary <string, object>
         {
             {
                 "Exception",
                 value
             }
         }, "CheckDirectoryIsWriteable", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Scratch\\ScratchManager.cs", 214);
         throw new Exception("Directory is not writeable");
     }
 }
コード例 #8
0
 // Token: 0x0600017C RID: 380 RVA: 0x0000710C File Offset: 0x0000530C
 private void EnsureDirectoryExists(string directory)
 {
     if (!Directory.Exists(directory))
     {
         try
         {
             Directory.CreateDirectory(directory);
         }
         catch (Exception value)
         {
             LoggerExtensionMethods.LogWarning <ScratchManager>(this, "Coludn't make scratch directory", new Dictionary <string, object>
             {
                 {
                     "Exception",
                     value
                 }
             }, "EnsureDirectoryExists", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Scratch\\ScratchManager.cs", 229);
             throw new Exception("Couldn't create directory");
         }
     }
 }
コード例 #9
0
 // Token: 0x06000179 RID: 377 RVA: 0x00006F90 File Offset: 0x00005190
 private void TeardownScratchSpace(string scratchDir)
 {
     LoggerExtensionMethods.LogDiagnostic <ScratchManager>(this, "Tearing down scratch space", null, "TeardownScratchSpace", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Scratch\\ScratchManager.cs", 165);
     if (Directory.Exists(scratchDir))
     {
         try
         {
             Directory.Delete(scratchDir, true);
         }
         catch (Exception value)
         {
             LoggerExtensionMethods.LogError <ScratchManager>(this, "Couldn't tear down scratch space", new Dictionary <string, object>
             {
                 {
                     "Exception",
                     value
                 }
             }, "TeardownScratchSpace", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Scratch\\ScratchManager.cs", 175);
         }
     }
 }
コード例 #10
0
        // Token: 0x0600017A RID: 378 RVA: 0x0000700C File Offset: 0x0000520C
        public void UpdateScratchRoot(string newRoot)
        {
            LoggerExtensionMethods.LogDiagnostic <ScratchManager>(this, "Attempting to change scratch root", new Dictionary <string, object>
            {
                {
                    "NewRoot",
                    newRoot
                }
            }, "UpdateScratchRoot", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Scratch\\ScratchManager.cs", 182);
            newRoot = this.tempPathProvider.RestoreEnvironmentVariables(newRoot);
            if (newRoot == this.ScratchRoot)
            {
                return;
            }
            string directory = this.tempPathProvider.ExpandEnvironmentVariables(newRoot);

            this.EnsureDirectoryExists(directory);
            this.CheckDirectoryIsWriteable(directory);
            this.TeardownScratchSpace();
            this.ScratchRoot = newRoot;
            this.InitializeScratchSpace();
        }
コード例 #11
0
        // Token: 0x06000177 RID: 375 RVA: 0x00006E70 File Offset: 0x00005070
        private void DetectAndHandleUncleanShutdown()
        {
            string cacheDirectory = this.GetCacheDirectory();

            if (Directory.Exists(cacheDirectory))
            {
                string    processName     = Process.GetCurrentProcess().ProcessName;
                Process[] processesByName = Process.GetProcessesByName(processName);
                string[]  directories     = Directory.GetDirectories(cacheDirectory);
                string[]  array           = directories;
                for (int i = 0; i < array.Length; i++)
                {
                    string text = array[i];
                    string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(text);
                    int    pid = -1;
                    if (int.TryParse(fileNameWithoutExtension, out pid))
                    {
                        if (!processesByName.Any((Process p) => p.Id == pid && !p.HasExited))
                        {
                            string path  = Path.Combine(text, this.SessionIdFileName);
                            string value = "No Session File Found";
                            if (File.Exists(path))
                            {
                                value = File.ReadAllText(path);
                            }
                            LoggerExtensionMethods.LogWarning <ScratchManager>(this, "Unclean shutdown detected", new Dictionary <string, object>
                            {
                                {
                                    "PreviousSessionId",
                                    value
                                }
                            }, "DetectAndHandleUncleanShutdown", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Scratch\\ScratchManager.cs", 149);
                            this.TeardownScratchSpace(text);
                        }
                    }
                }
            }
        }
コード例 #12
0
 // Token: 0x0600017D RID: 381 RVA: 0x00007174 File Offset: 0x00005374
 public void ResetScratchRoot()
 {
     LoggerExtensionMethods.LogDiagnostic <ScratchManager>(this, "Reset scratch root to default", null, "ResetScratchRoot", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Scratch\\ScratchManager.cs", 237);
 }
コード例 #13
0
 // Token: 0x060001AD RID: 429 RVA: 0x00007BD8 File Offset: 0x00005DD8
 public async Task <bool> CheckIfCanExit()
 {
     LoggerExtensionMethods.LogDiagnostic <MainWindowViewModel>(this, "Check if can exit", null, "CheckIfCanExit", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\ViewModels\\MainWindowViewModel.cs", 47);
     return(!(await this.WindowOperationsViewModel.CloseProject()));
 }
コード例 #14
0
 // Token: 0x060001AC RID: 428 RVA: 0x00007AA3 File Offset: 0x00005CA3
 public override void OnNavigatedTo(object[] args)
 {
     LoggerExtensionMethods.LogEvent <MainWindowViewModel>(this, "App Started", this.GetStartupProperties(), "OnNavigatedTo", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\ViewModels\\MainWindowViewModel.cs", 40);
     this.scratchManager.InitializeScratchSpace();
     base.Navigation.Navigate("Start", args);
 }
コード例 #15
0
        // Token: 0x06000252 RID: 594 RVA: 0x0000AD84 File Offset: 0x00008F84
        public bool Activate(string key)
        {
            try
            {
                if (!Directory.Exists(this.productInfo.ActivationRegistrationFolder))
                {
                    Directory.CreateDirectory(this.productInfo.ActivationRegistrationFolder);
                }
                if (Directory.Exists(this.productInfo.ActivationRegistrationFile))
                {
                    Directory.Delete(this.productInfo.ActivationRegistrationFile);
                    LoggerExtensionMethods.LogWarning <ActivationManager>(this, "Registration file was directory", null, "Activate", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Activation\\ActivationManager.cs", 57);
                }
            }
            catch (Exception value)
            {
                LoggerExtensionMethods.LogError <ActivationManager>(this, "Couldn't create directory for registration file", new Dictionary <string, object>
                {
                    {
                        "Exception",
                        value
                    }
                }, "Activate", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Activation\\ActivationManager.cs", 62);
                return(false);
            }
            int  num  = 0;
            bool flag = ActivationManager.ProductKeyValidator_Activate(this.instanceId, key, out num);

            if (flag)
            {
                string value2;
                string value3;
                string value4;
                this.GetActivationInfo(out value2, out value3, out value4);
                LoggerExtensionMethods.LogEvent <ActivationManager>(this, "Activated Product", new Dictionary <string, object>
                {
                    {
                        "ProductKey",
                        value2
                    },
                    {
                        "Pid2",
                        value4
                    },
                    {
                        "MPC",
                        value3
                    },
                    {
                        "FirstRun",
                        this.firstRunExperience.FirstRunTime.ToString()
                    },
                    {
                        "DaysToActivation",
                        DateTime.Now.Subtract(this.firstRunExperience.FirstRunTime).TotalDays
                    },
                    {
                        "VideosProcessedToActivation",
                        (double)this.firstRunExperience.VideosProcessed
                    }
                }, "Activate", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Activation\\ActivationManager.cs", 77);
            }
            else
            {
                LoggerExtensionMethods.LogEvent <ActivationManager>(this, "Couldn't activate product", new Dictionary <string, object>
                {
                    {
                        "Step",
                        num
                    }
                }, "Activate", "C:\\OxBuild\\30\\s\\hyperlapse_gui\\Hyperlapse\\Hyperlapse\\Model\\Activation\\ActivationManager.cs", 81);
            }
            return(flag);
        }