private static void Main()
 {
     PortableSettingsProvider.ApplyProvider(Properties.Settings.Default);
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new MainForm());
 }
Example #2
0
        static void Main()
        {
            int process = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length;

            if (process > 1)
            {
                return;
            }

            // Set DPI AWARE
            if (Environment.OSVersion.Version.Major >= 6)
            {
                SetProcessDPIAware();
            }

            PortableSettingsProvider.SettingsFileName  = "Settings.config";
            PortableSettingsProvider.SettingsDirectory = exePath;
            PortableSettingsProvider.ApplyProvider(Properties.Settings.Default);

            if (!File.Exists(exePath + "\\ResGen.exe"))
            {
                file = FileController.Instance;
                file.Dispose();
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Start();
        }
Example #3
0
 public MainLogic()
 {
     windows8  = CheckIfWin8OrHigher();
     uiContext = SynchronizationContext.Current;
     //addXImageToList = AddXimageToList;
     Uploader.ProgressBarUpdate                   = ProgressAndIconChange;
     ClipboardMonitor.ClipboardEvent             += new EventHandler(ClipboardChanged);
     BalloonMessage.ClipboardNotificationClicked += new EventHandler(ClipboardUpload);
     CreateSFTPConnectionInfo();
     OverlayRequest          = new InteractionRequest <IConfirmation>();
     this.GifOverlayRequest  = new InteractionRequest <IConfirmation>();
     this.GifEditorRequest   = new InteractionRequest <IConfirmation>();
     this.GifProgressRequest = new InteractionRequest <IConfirmation>();
     this.CancelCommand      = new DelegateCommand(CancelUpload);
     historyXMLPath          = Path.Combine(PortableSettingsProvider.GetAppSettingsPath(), "images.xml");
     Ximages       = ReadXML(historyXMLPath);
     CancelEnabled = false;
     ToggleClipboardMonitor();
     SoundPlayer.Init("custom.wav");
     if (string.IsNullOrWhiteSpace(settings.filePath))
     {
         SetDefaultPath();
     }
     StartUploads();
 }
Example #4
0
        public Main()
        {
            InitializeComponent();

            PortableSettingsProvider.SettingsFileName      = Common.USER_SETTINGS;
            PortableSettingsProviderBase.SettingsDirectory = Process.path_prefix;
            PortableSettingsProvider.ApplyProvider(Common.Settings.Default, Common.History.Default);

            Common.Settings.Default.Upgrade();
            Common.History.Default.Upgrade();

            debugLogToolStripMenuItem.Checked = Common.Settings.Default.DebugLog;

            aboutToolStripMenuItem.Text = String.Format("&About {0}", Application.ProductName);

            bool init = Process.initialize(out List <string> messages);

            foreach (var message in messages)
            {
                MessageBox.Show(message, Application.ProductName);
            }

            if (!init)
            {
                Environment.Exit(-1);
            }

            titles = Process.processHistory();

            reloadData();

            toolStripStatusLabel.Text = String.Format("{0} files", titles.Count);
        }
Example #5
0
        private void FormGUI_Load(object sender, EventArgs e)
        {
            //https://github.com/Bluegrams/SettingsProviders
            PortableSettingsProvider.SettingsFileName      = "Il2CppDumper.config";
            PortableSettingsProviderBase.SettingsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            PortableSettingsProvider.ApplyProvider(Settings.Default);

            binFileTxtBox.Text      = Settings.Default.BinaryFileTxtBox;
            datFileTxtBox.Text      = Settings.Default.DatFileTxtBox;
            outputTxtBox.Text       = Settings.Default.OutputTxtBox;
            androArch.SelectedIndex = Settings.Default.AndroArch;

            if (Settings.Default.RememberWindowPosition)
            {
                Location = Settings.Default.Location;
            }

            titleLbl.Text += " " + Version;

            if (IsAdministrator())
            {
                titleLbl.Text += " - Administrator ";
                Log("You are running as administrator. Drag and drop will not work\nIf this program is running as administrator by default, change your User Account Control back to default", Color.Yellow);
            }

            if (Settings.Default.CheckForUpdate)
            {
                CheckUpdate();
            }
        }
Example #6
0
        public static void Main()
        {
            PortableSettingsProvider.ApplyProvider(Calcex.Windows.Properties.Settings.Default);
            var application = new App();

            application.InitializeComponent();
            application.Run();
        }
        public void GetBlankXmlDocumentTest()
        {
            PortableSettingsProvider psp = new PortableSettingsProvider();
            XmlDocument blank            = psp.GetBlankXmlDocument();
            string      expected         = @"<?xml version=""1.0"" encoding=""utf-8""?><settings />";

            Assert.AreEqual(expected, blank.InnerXml);
        }
Example #8
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Sets the grid column widths from the specified string containing a comma-delimited
        /// list of integers.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public static void SetGridColumnWidthsFromString(DataGridView grid, string widths)
        {
            var colWidths = PortableSettingsProvider.GetIntArrayFromString(widths);

            for (int i = 0; i < colWidths.Length && i < grid.ColumnCount; i++)
            {
                grid.Columns[i].Width = colWidths[i];
            }
        }
        public override void WindowDidLoad()
        {
            base.WindowDidLoad();

            tableViewDataSource = new TableViewDataSource();
            tableViewDelegate   = new TableViewDelegate(tableViewDataSource);

            tableView.DataSource = tableViewDataSource;
            tableView.Delegate   = tableViewDelegate;

            PortableSettingsProvider.SettingsFileName      = Common.USER_SETTINGS;
            PortableSettingsProviderBase.SettingsDirectory = Process.path_prefix;
            PortableSettingsProvider.ApplyProvider(Common.Settings.Default, Common.History.Default);

            Common.Settings.Default.Upgrade();
            Common.History.Default.Upgrade();

            NSMenuItem debugLog = Window.Menu?.ItemWithTitle("File")?.Submenu.ItemWithTitle("Debug Log");

            if (debugLog != null)
            {
                debugLog.State = Common.Settings.Default.DebugLog ? NSCellStateValue.On : NSCellStateValue.Off;
            }

            bool init = Process.initialize(out List <string> messages);

            foreach (var message in messages)
            {
                var alert = new NSAlert()
                {
                    InformativeText = message,
                    MessageText     = NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleExecutable").ToString(),
                };
                alert.RunModal();
            }

            if (!init)
            {
                Environment.Exit(-1);
            }

            backgroundWorker = new BackgroundWorker
            {
                WorkerReportsProgress      = true,
                WorkerSupportsCancellation = true
            };
            backgroundWorker.DoWork             += BackgroundWorker_DoWork;
            backgroundWorker.ProgressChanged    += BackgroundWorker_ProgressChanged;
            backgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted;

            titles = Process.processHistory();

            tableViewDataSource.Titles.AddRange(titles);

            tableView.ReloadData();
        }
Example #10
0
 static void Main()
 {
     if (AppInfo.IsPortable.GetValueOrDefault())
     {
         PortableSettingsProvider.ApplyProvider(Settings.Default);
     }
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new MainApplicationContext());
 }
Example #11
0
 private static void MakePortable(ApplicationSettingsBase settings)
 {
     var portableSettingsProvider = new PortableSettingsProvider();
     settings.Providers.Add(portableSettingsProvider);
     foreach (SettingsProperty prop in settings.Properties)
     {
         prop.Provider = portableSettingsProvider;
     }
     settings.Reload();
 }
Example #12
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            PortableSettingsProvider.SettingsFileName  = "ClientRtkGps.config";
            PortableSettingsProvider.SettingsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"DSS\configuration\");
            PortableSettingsProvider.ApplyProvider(Settings.Default);

            Application.Run(new RtkForm());
        }
Example #13
0
 static void Main()
 {
     AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
     if (AppInfo.IsPortable.GetValueOrDefault())
     {
         PortableSettingsProvider.ApplyProvider(Settings.Default);
     }
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new MainApplicationContext());
 }
        public static void InitializeSettings()
        {
            Settings.Default.Upgrade();
            var provider = new PortableSettingsProvider();

            Settings.Default.Providers.Add(provider);
            foreach (SettingsProperty property in Settings.Default.Properties)
            {
                property.Provider = provider;
            }
        }
Example #15
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Builds a comma-delimited string of integers representing all the column widths of
        /// the specified grid.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public static string StoreGridColumnWidthsInString(DataGridView grid)
        {
            // Persist the width of each column on the files tab.
            var colWidths = new int[grid.Columns.Count];

            for (int i = 0; i < grid.ColumnCount; i++)
            {
                colWidths[i] = grid.Columns[i].Width;
            }

            return(PortableSettingsProvider.GetStringFromIntArray(colWidths));
        }
Example #16
0
        private static void MakePortable(ApplicationSettingsBase settings)
        {
            var portableSettingsProvider =
                new PortableSettingsProvider("Mist.settings");

            settings.Providers.Add(portableSettingsProvider);
            foreach (System.Configuration.SettingsProperty prop in settings.Properties)
            {
                prop.Provider = portableSettingsProvider;
            }
            settings.Reload();
        }
Example #17
0
        protected override void OnSettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            Log.InfoFormat("Settings Loaded");
            base.OnSettingsLoaded(sender, e);

            PortableSettingsProvider provider = e.Provider as PortableSettingsProvider;

            if (provider != null)
            {
                SettingsFilePath = provider.SettingsFilePath;
            }
        }
Example #18
0
 /// <summary>
 /// Applies this settings provider to each property of the given settings.
 /// </summary>
 /// <param name="settingsList">An array of settings.</param>
 public static void ApplyProvider(params ApplicationSettingsBase[] settingsList)
 {
     foreach (var settings in settingsList)
     {
         var provider = new PortableSettingsProvider();
         settings.Providers.Add(provider);
         foreach (SettingsProperty prop in settings.Properties)
         {
             prop.Provider = provider;
         }
         settings.Reload();
     }
 }
Example #19
0
        /// ------------------------------------------------------------------------------------
        private void Initialize(string imageFileName)
        {
            var clickZoomPercentages = PortableSettingsProvider.GetIntArrayFromString(
                Settings.Default.ImageViewerClickImageZoomPercentages);

            if (_model != null)
            {
                _model.Dispose();
                _model = null;
            }

            _model = new ImageViewerViewModel(imageFileName, clickZoomPercentages);
        }
        } // end method ApplyTheme

        /// <summary>
        /// Configure the customised settings provider.
        /// </summary>
        private void ConfigSettingsProvider()
        {
            PortableSettingsProvider.SettingsFileName = "user.config";

            if (_productId != null && _productCompany != null)
            {
                var customisedSettingsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), _productCompany, _productId);

                if (!Directory.Exists(customisedSettingsDirectory))
                    Directory.CreateDirectory(customisedSettingsDirectory);

                PortableSettingsProviderBase.SettingsDirectory = customisedSettingsDirectory;
            } // end if

            PortableSettingsProvider.ApplyProvider(ShSzStockHelper.Properties.Settings.Default);
        } // end method ConfigSettingsProvider
Example #21
0
        public Main()
        {
            InitializeComponent();

            PortableSettingsProvider.SettingsFileName      = Common.USER_SETTINGS;
            PortableSettingsProviderBase.SettingsDirectory = Process.path_prefix;
            PortableSettingsProvider.ApplyProvider(Common.Settings.Default, Common.History.Default);

            Common.Settings.Default.Upgrade();
            Common.History.Default.Upgrade();

            debugLogToolStripMenuItem.Checked = Common.Settings.Default.DebugLog;

            aboutToolStripMenuItem.Text = String.Format("&About {0}", Application.ProductName);

            int index = 0;

            foreach (string property in Title.Properties)
            {
                ToolStripMenuItem menuItem = new ToolStripMenuItem
                {
                    Name = String.Format("property{0}ToolStripMenuItem", index++),
                    Text = property,
                };
                menuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
                copyToolStripMenuItem.DropDownItems.Add(menuItem);
            }

            bool init = Process.initialize(out List <string> messages);

            foreach (var message in messages)
            {
                MessageBox.Show(message, Application.ProductName);
            }

            if (!init)
            {
                Environment.Exit(-1);
            }

            Process.migrateSettings();
        }
Example #22
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
#if PORTABLE
            PortableSettingsProvider.ApplyProvider(Settings.Default);
#endif
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;;
            initializeDefaultSettings();
            // register services and view models
            registerServices();
            InitializeDownloadEngine();
            registerVMs();
            // apply theme
            var themeResolver = SimpleIoc.Default.GetInstance <IThemeResolver>();
            themeResolver.SetColorScheme(Settings.Default.AppTheme);
            // setup main window
            MainWindow mainWindow = new MainWindow();
            mainWindow.DataContext = SimpleIoc.Default.GetInstance <MainViewModel <MediaEntry> >();
            SimpleIoc.Default.Register <IUpdateChecker>(
                () => new WpfUpdateChecker(UPDATE_URL, mainWindow, UPDATE_IDENTIFIER));
            mainWindow.Show();
        }
Example #23
0
        /// <summary>
        /// Initializes a new instance of Settings classs
        /// </summary>
        public Settings()
        {
            // // To add event handlers for saving and changing settings, uncomment the lines below:
            //
            // this.SettingChanging += this.SettingChangingEventHandler;
            //
            // this.SettingsSaving += this.SettingsSavingEventHandler;
            //

            var runningMode = Application.RunningMode;

            if (runningMode == RunningMode.Portable || runningMode == RunningMode.Service)
            {
                var portableSettingsProvider = new PortableSettingsProvider("user.config");
                Providers.Add(portableSettingsProvider);
                foreach (SettingsProperty prop in Properties)
                {
                    prop.Provider = portableSettingsProvider;
                }
            }
        }
Example #24
0
        public void AutoOpen()
        {
            PortableSettingsProvider.AllRoaming       = true;
            PortableSettingsProvider.SettingsFileName = "FFE.config";
            PortableSettingsProvider.ApplyProvider(AvqSetting.Default);
            PortableSettingsProvider.ApplyProvider(CbqSetting.Default);
            PortableSettingsProvider.ApplyProvider(PlugInSetting.Default);
            PortableSettingsProvider.ApplyProvider(SsqSetting.Default);
            PortableSettingsProvider.ApplyProvider(FfeSetting.Default);

            Log.Logger = FfeLogger.CreateDefaultLogger();

            if (FfeSetting.Default.CheckUpdateOnStartup)
            {
                FfeUpdate.CheckUpdate(false);
            }

            if (FfeSetting.Default.RegisterFunctionsOnStartup)
            {
                RegisterFunctions();
                RegisterDelegates();
            }
        }
        public static void InitilizeSettings()
        {
            // Tool Initial Settings

            if (!Directory.Exists(exePath + @"\Logs\"))
            {
                Directory.CreateDirectory(exePath + @"\Logs\");
            }

            CheckNetFamework.IFNOT48();

            if (!Directory.Exists(exePath + @"\Settings\"))
            {
                Directory.CreateDirectory(exePath + @"\Settings\");
            }

            PortableSettingsProvider.SettingsFileName  = "Settings.config";
            PortableSettingsProvider.SettingsDirectory = "Settings\\";
            PortableSettingsProvider.ApplyProvider(Properties.Settings.Default);
            PortableSettingsProvider.ApplyProvider(Properties.Profiles.Default);

            var res_man = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));

            if (!OSVersionInfo.Name.Equals("Windows 10") && !OSVersionInfo.Name.Equals("Windows 8.1") && !OSVersionInfo.Name.Equals("Windows 8") && !OSVersionInfo.Name.Equals("Windows 7"))
            {
                CheckNetFamework.Get48FromRegistry();
                MessageBox.Show(res_man.GetString("ProgramCheckWindows", cul) + " " + OSVersionInfo.Name, res_man.GetString("ProgramCheckWindows2", cul), MessageBoxButtons.OK, MessageBoxIcon.Error);
                Kill.PanicKillInternal();
                return;
            }
            else
            {
                CheckNetFamework.Get48FromRegistry();
            }

            string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            if (Properties.Settings.Default.ToolVersion == "")
            {
                if (Properties.Settings.Default.UpgradeRequired == true)
                {
                    Properties.Settings.Default.Upgrade();
                    Properties.Settings.Default.UpgradeRequired = false;
                }
                Properties.Settings.Default.ToolVersion = version;
                Properties.Settings.Default.Save();
            }

            if (version != Properties.Settings.Default.ToolVersion)
            {
                Properties.Settings.Default.ToolVersion = version;
                Properties.Settings.Default.Save();
            }

            if (CheckAdmin.IsUserAdministrator() == true)
            {
                Properties.Settings.Default.IsAdmin = true;
                Properties.Settings.Default.Save();
            }
            else
            {
                Properties.Settings.Default.IsAdmin = false;
                Properties.Settings.Default.Save();
            }

            if (Properties.Settings.Default.LogoWasSaved == true)
            {
                Properties.Settings.Default.LogoWasSaved = false;
                Properties.Settings.Default.Save();
            }

            if (Properties.Settings.Default.LogoBinOpenSave == false)
            {
                Properties.Settings.Default.LogoWasSaved = false;
                Properties.Settings.Default.LogoBinOpen  = "";
                Properties.Settings.Default.Save();
            }

            string x86path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
            string x64path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

            if (exePath == x86path || exePath == x64path)
            {
                if (CheckAdmin.IsUserAdministrator() == false)
                {
                    MessageBox.Show(res_man.GetString("ProgramCheckPrivileges", cul), res_man.GetString("ProgramCheckPrivileges2", cul), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Kill.PanicKillInternal();
                    return;
                }
            }

            if (!Directory.Exists(exePath + @"\Files\"))
            {
                Directory.CreateDirectory(exePath + @"\Files\");
            }

            CreateDirectory(@"LogoZip");
            CreateDirectory(@"Images\Logo");
            CreateDirectory(@"Images\Icons");
            CreateDirectory(@"Bin");
            CreateDirectory(@"Bin\4MB");
            CreateDirectory(@"Bin\6MB");
            CreateDirectory(@"Bin\8MB");
            CreateDirectory(@"Bin\16MB");
            CreateDirectory(@"Bin\32MB");

            if (File.Exists(exePath + @"\Files\*.zip"))
            {
                File.Delete(exePath + @"\Files\*.zip");
            }

            if (File.Exists(exePath + @"\*.zip"))
            {
                File.Delete(exePath + @"\*.zip");
            }
        }
Example #26
0
 protected override void OnStartup(object sender, StartupEventArgs e)
 {
     PortableSettingsProvider.ApplyProvider(Model.Properties.Settings.Default);
     DisplayRootViewFor <MasterViewModel>();
 }
Example #27
0
        public static bool GetUpdate(bool autoCheck)
        {
            UpdateInfo ui  = null;
            string     ini = PortableSettingsProvider.GetApplicationIniFile("Update");

            if (!File.Exists(ini))
            {
                CopyableMessageBox.Show(
                    "Problem checking for update" + (autoCheck ? " - will try again later" : "") + "\n"
                    + ini + " - not found"
                    , PortableSettingsProvider.ExecutableName + " AutoUpdate"
                    , CopyableMessageBoxButtons.OK
                    , CopyableMessageBoxIcon.Error);
                return(true);
            }
            try
            {
                string url = new StreamReader(ini).ReadLine();
                if (url == null)
                {
                    throw new IOException(ini + " - failed to read url");
                }
                url = url.Trim();
                try
                {
                    using (S4PIDemoFE.Splash splash = new S4PIDemoFE.Splash("Checking for updates..."))
                    {
                        splash.Show();
                        Application.DoEvents();
                        ui = new UpdateInfo(url);
                    }
                }
                catch (System.Net.WebException we)
                {
                    if (we != null)
                    {
                        CopyableMessageBox.Show(
                            "Problem checking for update" + (autoCheck ? " - will try again later" : "") + "\n"
                            + (we.Response != null ? "\nURL: " + we.Response.ResponseUri : "")
                            + "\n" + we.Message
                            , PortableSettingsProvider.ExecutableName + " AutoUpdate"
                            , CopyableMessageBoxButtons.OK
                            , CopyableMessageBoxIcon.Error);
                        return(true);
                    }
                }
            }
            catch (IOException ioe)
            {
                CopyableMessageBox.Show(
                    "Problem checking for update" + (autoCheck ? " - will try again later" : "") + "\n"
                    + ioe.Message
                    , PortableSettingsProvider.ExecutableName + " AutoUpdate"
                    , CopyableMessageBoxButtons.OK
                    , CopyableMessageBoxIcon.Error);
                return(true);
            }

            if (UpdateApplicable(ui, autoCheck))
            {
                int dr = CopyableMessageBox.Show(
                    String.Format("{0}\n{3}\n\nCurrent version: {1}\nAvailable version: {2}",
                                  ui.Message, Version.CurrentVersion, ui.AvailableVersion, ui.UpdateURL)
                    , PortableSettingsProvider.ExecutableName + " update available"
                    , CopyableMessageBoxIcon.Question
                    , new List <string>(new string[] { "&Visit link", "&Later", "&Skip version", }), 1, 2
                    );

                switch (dr)
                {
                case 0: System.Diagnostics.Process.Start(ui.UpdateURL); break;

                case 2: pgmSettings.AULastIgnoredVsn = ui.AvailableVersion; pgmSettings.Save(); break;
                }
                return(true);
            }
            return(false);
        }
        public override void WindowDidLoad()
        {
            base.WindowDidLoad();

            tableViewDataSource = new TableViewDataSource();
            tableViewDelegate   = new TableViewDelegate(tableViewDataSource);

            tableView.DataSource = tableViewDataSource;
            tableView.Delegate   = tableViewDelegate;

            PortableSettingsProvider.SettingsFileName      = Common.USER_SETTINGS;
            PortableSettingsProviderBase.SettingsDirectory = Process.path_prefix;
            PortableSettingsProvider.ApplyProvider(Common.Settings.Default, Common.History.Default);

            Common.Settings.Default.Upgrade();
            Common.History.Default.Upgrade();

            NSMenuItem debugLog = Window.Menu?.ItemWithTitle("File")?.Submenu.ItemWithTitle("Debug Log");

            if (debugLog != null)
            {
                debugLog.State = Common.Settings.Default.DebugLog ? NSCellStateValue.On : NSCellStateValue.Off;
            }

            historyMenu = Window.Menu?.ItemWithTitle("History")?.Submenu;

            InitContextMenu(contextMenu.ItemWithTitle("Copy")?.Submenu);

            bool init = Process.initialize(out List <string> messages);

            foreach (var message in messages)
            {
                var alert = new NSAlert()
                {
                    InformativeText = message,
                    MessageText     = NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleExecutable").ToString(),
                };
                alert.RunModal();
            }

            if (!init)
            {
                Environment.Exit(-1);
            }

            Process.migrateSettings();

            backgroundWorker = new BackgroundWorker
            {
                WorkerReportsProgress      = true,
                WorkerSupportsCancellation = true
            };
            backgroundWorker.DoWork             += BackgroundWorker_DoWork;
            backgroundWorker.ProgressChanged    += BackgroundWorker_ProgressChanged;
            backgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted;

            int index = 0;

            foreach (ArrayOfTitle history in Common.History.Default.Titles)
            {
                NSMenuItem menuItem = new NSMenuItem(String.Format("{0} ({1} files)", history.description, history.title.Count), new System.EventHandler(History));
                historyMenu.AddItem(menuItem);

                index++;
            }

            if (index > 0)
            {
                historyMenu.Items[index - 1].State = NSCellStateValue.On;
            }

            titles = Process.processHistory();

            tableViewDataSource.Titles.AddRange(titles);

            tableView.ReloadData();
        }
Example #29
0
 public static void Initialize(TestContext context)
 {
     settingsFile = "portable.config";
     PortableSettingsProvider.ApplyProvider(Properties.Settings.Default);
     Properties.Settings.Default.Reset();
 }
Example #30
0
 // PortableSettingsProvider code obtained from http://stackoverflow.com/a/2579399 (Accessed 02-01-2014 @ 17:04).
 private static void MakeSettingsPortable(ApplicationSettingsBase settings)
 {
     var portableSettingsProvider = new PortableSettingsProvider(settings.GetType().Name + ".settings");
     settings.Providers.Add(portableSettingsProvider);
     foreach (SettingsProperty prop in settings.Properties)
         prop.Provider = portableSettingsProvider;
     settings.Reload();
 }