예제 #1
0
            public PluginServer(QTTabBarClass tabBar)
            {
                BandObjectLib.Logging.Add_DEBUG("Constructor.log", "PluginServer");

                this.tabBar          = tabBar;
                shellBrowser         = (BandObjectLib.Interop.QTPluginLib.IShellBrowser) this.tabBar.ShellBrowser.GetIShellBrowser();
                dicLocalizingStrings = new Dictionary <string, string[]>();
                foreach (string file in Config.Lang.PluginLangFiles)
                {
                    if (file.Length <= 0 || !File.Exists(file))
                    {
                        continue;
                    }
                    var dict = QTUtility.ReadLanguageFile(file);
                    if (dict == null)
                    {
                        continue;
                    }
                    foreach (var pair in dict)
                    {
                        dicLocalizingStrings[pair.Key] = pair.Value;
                    }
                }
                LoadStartupPlugins();
            }
 private void btnPluginAdd_Click(object sender, RoutedEventArgs e)
 {
     using (OpenFileDialog ofd = new OpenFileDialog()) {
         ofd.Filter           = QTUtility.TextResourcesDic["FileFilters"][1] + "|*.xml";
         ofd.RestoreDirectory = true;
         if (DialogResult.OK != ofd.ShowDialog())
         {
             return;
         }
         var dict = QTUtility.ReadLanguageFile(ofd.FileName);
         if (dict != null)
         {
             PluginFiles.Add(ofd.FileName);
         }
     }
 }
예제 #3
0
 public static void UpdateConfig(bool fBroadcast = true)
 {
     QTUtility.TextResourcesDic = Config.Lang.UseLangFile && File.Exists(Config.Lang.LangFile)
             ? QTUtility.ReadLanguageFile(Config.Lang.LangFile)
             : null;
     QTUtility.ValidateTextResources();
     StaticReg.ClosedTabHistoryList.MaxCapacity = Config.Misc.TabHistoryCount;
     StaticReg.ExecutedPathsList.MaxCapacity    = Config.Misc.FileHistoryCount;
     DropDownMenuBase.InitializeMenuRenderer();
     ContextMenuStripEx.InitializeMenuRenderer();
     PluginManager.RefreshPlugins();
     InstanceManager.LocalTabBroadcast(tabbar => tabbar.RefreshOptions());
     if (fBroadcast)
     {
         // SyncTaskBarMenu(); todo
         InstanceManager.StaticBroadcast(() => {
             ReadConfig();
             UpdateConfig(false);
         });
     }
 }
 private void btnLoad_Click(object sender, RoutedEventArgs e)
 {
     using (OpenFileDialog ofd = new OpenFileDialog()) {
         ofd.Filter           = QTUtility.TextResourcesDic["FileFilters"][1] + "|*.xml";
         ofd.RestoreDirectory = true;
         if (DialogResult.OK != ofd.ShowDialog())
         {
             return;
         }
         var dict = QTUtility.ReadLanguageFile(ofd.FileName);
         QTUtility.ValidateTextResources(ref dict);
         foreach (LangEntry entry in LangItems)
         {
             if (entry.Index >= 0)
             {
                 entry.Translated = dict[entry.Key][entry.Index];
             }
             else
             {
                 entry.Translated = dict[entry.Key][0];
             }
         }
     }
 }
예제 #5
0
 public static Dictionary <String, String[]> testQTUtilityReadLanguageFile(string path)
 {
     return(QTUtility.ReadLanguageFile(path));
 }