Esempio n. 1
0
        private void SyncFormLoad(object sender, EventArgs e)
        {
            _settings = FrbdkUpdaterSettings.LoadSettings();

            if (!string.IsNullOrEmpty(_settings.SelectedDirectory))
            {
                tbPath.Text = _settings.SelectedDirectory;
            }

            cbCleanFolder.Checked   = _settings.CleanFolder;
            cbForceDownload.Checked = _settings.ForceDownload;
        }
        public static bool TryLoadSettingsFromuserAppFolder(string userAppPath, out FrbdkUpdaterSettings loadedOrCreated)
        {
            bool wasLoadedFromFile = false;
            var  fileName          = userAppPath + @"FRBDK/" + Filename;

            if (System.IO.File.Exists(fileName))
            {
                loadedOrCreated   = LoadSettings(fileName);
                wasLoadedFromFile = true;
            }
            loadedOrCreated = new FrbdkUpdaterSettings();

            return(wasLoadedFromFile);
        }
        void CreateShortcutFor(string fileName, string description)
        {
            using (ShellLink shortcut = new ShellLink())
            {
                // The file that the .lnk file links to
                string target = //ComponentStorage.GetValue<string>(FrbdkSetupComponent.Path)
                                FrbdkUpdaterManager.FrbdkInProgramFiles
                                + fileName;
                shortcut.Target           = target;
                shortcut.WorkingDirectory = Path.GetDirectoryName(target);
                shortcut.Description      = description;
                shortcut.DisplayMode      = ShellLink.LinkDisplayMode.edmNormal;

                // Where to save the .lnk file
                shortcut.Save(StartMenuFolder + FileManager.RemovePath(FileManager.RemoveExtension(fileName)) + ".lnk");
            }
        }
        private void SyncFormLoad(object sender, EventArgs e)
        {
            BuildMenu();
            _settings   = FrbdkUpdaterSettings.LoadSettings();
            tbPath.Text = _settings.SelectedDirectory;

            foreach (Item item in cbSyncTo.Items)
            {
                if (item.Value == _settings.SelectedSource)
                {
                    cbSyncTo.SelectedItem = item;
                    break;
                }
            }

            cbCleanFolder.Checked   = _settings.CleanFolder;
            cbForceDownload.Checked = _settings.ForceDownload;
        }