Beispiel #1
0
        private void ModelActivateChange(int aOldIndex, int aNewIndex)
        {
            _currentTabIndex = aNewIndex;
            Properties.Settings.Default.TabIndex = _currentTabIndex;

            var tabs = new Models.ITabModel[] { MModel, EModel, DModel, NModel }; // jwoh add Micom Download only

            // inactivate
            foreach (var tabModel in tabs)
            {
                if ((int)tabModel.TabId == aOldIndex)
                {
                    tabModel.TabActiveChanged(false);
                }
            }

            // activate
            foreach (var tabModel in tabs)
            {
                if ((int)tabModel.TabId == aNewIndex)
                {
                    tabModel.TabActiveChanged(true);
                }
            }
        }
Beispiel #2
0
 static public void UIThreadInvoke(this Models.ITabModel aModel, Action code)
 {
     if (!MainModel.Window.Dispatcher.CheckAccess())
     {
         MainModel.Window.Dispatcher.Invoke(code);
         return;
     }
     code.Invoke();
 }
Beispiel #3
0
        public static string TempConfigFile(Models.ITabModel aModel)
        {
            var path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Gen11Downloader";

            if (!System.IO.Directory.Exists(path))
            {
                System.IO.Directory.CreateDirectory(path);
            }

            return(path + @"\" + aModel.TabId.ToString() + ConfigXmlFileName);
        }