コード例 #1
0
        private void finalizeCodeActivity_Finalize_ExecuteCode(object sender, EventArgs e)
        {
            DeleteTreeRefresher deleteTreeRefresher = this.CreateDeleteTreeRefresher(this.EntityToken);

            ISystemActiveLocale systemActiveLocale = this.GetDataItemFromEntityToken <ISystemActiveLocale>();

            var cultureName = systemActiveLocale.CultureName;

            var consolesToBeUpdated =
                (from consoleInformation in DataFacade.GetData <IUserConsoleInformation>()
                 join userSettings in DataFacade.GetData <IUserSettings>()
                 on consoleInformation.Username equals userSettings.Username
                 where userSettings.CurrentActiveLocaleCultureName == cultureName ||
                 userSettings.ForeignLocaleCultureName == cultureName
                 select consoleInformation.ConsoleId).ToList();

            LocalizationFacade.RemoveLocale(cultureName);

            foreach (var consoleId in consolesToBeUpdated)
            {
                ConsoleMessageQueueFacade.Enqueue(new CollapseAndRefreshConsoleMessageQueueItem(), consoleId);
            }

            ConsoleMessageQueueFacade.Enqueue(new BroadcastMessageQueueItem {
                Name = "LocalesUpdated", Value = ""
            }, null);

            SelectElement(new LocalizationElementProviderRootEntityToken());

            deleteTreeRefresher.PostRefreshMesseges();
        }
コード例 #2
0
        private void finalizeCodeActivity_Finalize_ExecuteCode(object sender, EventArgs e)
        {
            DeleteTreeRefresher deleteTreeRefresher = this.CreateDeleteTreeRefresher(this.EntityToken);

            ISystemActiveLocale systemActiveLocale = this.GetDataItemFromEntityToken <ISystemActiveLocale>();

            LocalizationFacade.RemoveLocale(systemActiveLocale.CultureName);

            ConsoleMessageQueueFacade.Enqueue(new CollapseAndRefreshConsoleMessageQueueItem(), null);
            ConsoleMessageQueueFacade.Enqueue(new BroadcastMessageQueueItem {
                Name = "LocalesUpdated", Value = ""
            }, null);

            deleteTreeRefresher.PostRefreshMesseges();
        }
コード例 #3
0
        /// <exclude />
        public override void Uninstall()
        {
            if (_oldDefaultCultureInfo != null)
            {
                Log.LogVerbose("LocalePackageFragmentUninstaller", string.Format("Restoring default locale to '{0}'", _oldDefaultCultureInfo));

                LocalizationFacade.SetDefaultLocale(_oldDefaultCultureInfo);
            }


            foreach (CultureInfo locale in _culturesToUninstall.Reverse <CultureInfo>())
            {
                Log.LogVerbose("LocalePackageFragmentUninstaller", string.Format("Removing the locale '{0}'", locale));

                LocalizationFacade.RemoveLocale(locale, false);
            }
        }