예제 #1
0
        public static void InitializeWithAutoupdateProtectedFileList()
        {
            var pendingUpdates = AutoUpdate.GetPendingUpdateQueues(ServiceHandler.Service);

            var protectedList = new List <string>();

            foreach (var filesInLobbyUpdatePackage in pendingUpdates.AllFilesInUpdatePackage)
            {
                foreach (var item in filesInLobbyUpdatePackage.Value)
                {
                    string basePath = String.Empty;

                    if (item.LobbyId != null)
                    {
                        basePath = ((LobbyType)item.LobbyId).ToString();
                    }

                    if (item.IsProtected)
                    {
                        var filename = item.Filename.ToLower();

                        if (filename.StartsWith(@"\"))                         //Remove preceding '\'
                        {
                            filename = filename.Remove(0, 1);
                        }

                        protectedList.Add(Path.Combine(basePath, filename).ToLower());
                    }
                }
            }

            SystemWatcher.Initialize(protectedList);
        }
예제 #2
0
        static void process_OnExiting(object sender, EventArgs e)
        {
            Log.Write("AllegianceLoader::process_OnExiting - Called!");

            _allegianceProcess        = null;
            _allegianceProcessMonitor = null;


            //Disable system watcher
            SystemWatcher.Close();

            Log.Write("AllegianceLoader::process_OnExiting - System Watcher Closed.");

            if (AllegianceExit != null)
            {
                Log.Write("AllegianceLoader::process_OnExiting - Calling Allegiance Exit.");
                AllegianceExit(sender, e);
            }

            AllegianceExit = null;
        }