コード例 #1
0
ファイル: FS_Watcher.cs プロジェクト: VulpesSARL/Fox-SDC
        public static void InstallFSW()
        {
            string AppPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            if (AppPath.EndsWith("\\") == false)
            {
                AppPath += "\\";
            }
            AppPath += "Packages\\";

            if (Directory.Exists(AppPath) == false)
            {
                FoxEventLog.WriteEventLog("The directory " + AppPath + " does not exist. Note that clients will not be able to download their updates. Make sure the directory exists and the proper contents are available then restart this server application.", System.Diagnostics.EventLogEntryType.Warning);
            }
            else
            {
                updatepackagesfsw                     = new FileSystemWatcher(AppPath, "*.foxpkg");
                updatepackagesfsw.Changed            += Fsw_Changed;
                updatepackagesfsw.Renamed            += Fsw_Renamed;
                updatepackagesfsw.Created            += Fsw_Created;
                updatepackagesfsw.Deleted            += Fsw_Deleted;
                updatepackagesfsw.EnableRaisingEvents = true;
                ClientUpdate.ReadCheckVersions();
            }

            AppPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            if (AppPath.EndsWith("\\") == false)
            {
                AppPath += "\\";
            }

            licensefsw                     = new FileSystemWatcher(AppPath, "License.lic");
            licensefsw.Changed            += Licensefsw_Changed;
            licensefsw.Renamed            += Licensefsw_Renamed;
            licensefsw.Created            += Licensefsw_Created;
            licensefsw.Deleted            += Licensefsw_Deleted;
            licensefsw.EnableRaisingEvents = true;

            SDCLicensing.LoadLic();
        }
コード例 #2
0
ファイル: FS_Watcher.cs プロジェクト: VulpesSARL/Fox-SDC
 private static void Licensefsw_Changed(object sender, FileSystemEventArgs e)
 {
     Thread.Sleep(1000);
     SDCLicensing.LoadLic();
 }
コード例 #3
0
ファイル: FS_Watcher.cs プロジェクト: VulpesSARL/Fox-SDC
 private static void Licensefsw_Renamed(object sender, RenamedEventArgs e)
 {
     Thread.Sleep(1000);
     SDCLicensing.LoadLic();
 }