示例#1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     var settings = new Properties.Settings();
     settings.ChocolateyLibDirectory = txtInstallDirectory.Text;
     settings.Save();
     Dispose();
 }
示例#2
0
		private void SaveUserSettings()
		{
			Properties.Settings userSettings = new Properties.Settings();
			userSettings.MappingListFormLocation = this.Location;
			userSettings.MappingListFormWidth = this.Width;
			userSettings.Save();
		}
示例#3
0
        public void LoadUserSettings()
        {
            Properties.Settings userSettings = new Properties.Settings();

            int savedWidth = userSettings.MappingListFormWidth;

            if (savedWidth > _minimumWidth)
                Width = savedWidth;
        }
示例#4
0
文件: Options.cs 项目: DeSciL/Ogama
    ///////////////////////////////////////////////////////////////////////////////
    // Construction and Initializing methods                                     //
    ///////////////////////////////////////////////////////////////////////////////
    #region CONSTRUCTION

    /// <summary>
    /// Initializes a new instance of the Options class.
    /// </summary>
    public Options()
    {
      this.InitializeComponent();
      this.curSettings = global::Ogama.Properties.Settings.Default;
      this.cbbGazeCursorType.Items.AddRange(Enum.GetNames(typeof(VGCursor.DrawingCursors)));
      this.cbbMouseCursorType.Items.AddRange(Enum.GetNames(typeof(VGCursor.DrawingCursors)));
      this.cbbGazeFixationsDisplayMode.Items.AddRange(Enum.GetNames(typeof(FixationDrawingMode)));
      this.cbbMouseFixationsDisplayMode.Items.AddRange(Enum.GetNames(typeof(FixationDrawingMode)));
      this.cbbPresentationMonitor.Items.AddRange(Enum.GetNames(typeof(Monitor)));
    }
示例#5
0
文件: Xml.cs 项目: mwinkel/fit_tool
        public Xml()
        {
            settings = Properties.Settings.Default;
            settings.Reload();

            this.xml_path = settings.xml_path;

            try {
                if(!(new FileInfo(xml_path).Exists)) {
                    createXmlFile();
                    MessageBox.Show("Xml File '" + xml_path + "' wurde angelegt.");
                }
            }
            catch(Exception ex) {
                MessageBox.Show(ex.ToString());
            }
        }
示例#6
0
        public ColourMap()
        {
            if (AppController.UserCannotWriteToApplicationRegistryKey)
                _toolTipText = "Right-click to change which buttons are shown";
            else
                _toolTipText = "Double-click a button to edit the colour: right click for more options";

            InitializeComponent();

            Properties.Settings userSettings = new Properties.Settings();
            _showAllButtons = userSettings.ColourMapShowAllButtons;

            CreateContextMenu();
            Redraw();

            MappingsManager.MappingsChanged += delegate(object sender, EventArgs e) { Redraw(); };
            UserColourSettingManager.ColoursChanged += delegate(object sender, EventArgs e) { Redraw(false); };
        }
示例#7
0
文件: Main.cs 项目: tmzu/keymapper
		static void Main()
		{
			if (AppController.IsOnlyAppInstance() == false)
			{
				return;
			}

			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
			Application.ThreadException += ApplicationThreadException;
			AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;

            AppController.CreateAppDirectory();

#if DEBUG
#else
			Console.Write("Redirecting console output");
			LogProvider.RedirectConsoleOutput();
#endif

            ConfigFileProvider.ValidateUserConfigFile();

			Properties.Settings userSettings = new Properties.Settings();
			if (userSettings.UpgradeRequired)
			{
                Console.WriteLine("Upgrading settings to new version");
				userSettings.Upgrade();
				userSettings.UpgradeRequired = false;
				userSettings.Save();
			}

			AppController.Start();

			Application.Run(new KeyboardForm());

			AppController.Close();
			// Release static events or else leak.
			Application.ThreadException -= ApplicationThreadException;
			AppDomain.CurrentDomain.UnhandledException -= UnhandledExceptionHandler;

		}
示例#8
0
        public MainWindow()
        {
            InitializeComponent();
            _aboutBox = new AboutBox();

            // fills _settings form
            _settings = new Properties.Settings();
            txtFenstername.Text = _settings.Fenstername;

            foreach (string anchor in _settings.Anker)
            {
                boxAnker.Items.Add(anchor);
            }
            if (boxAnker.Items.Count > 0)
            {
                boxAnker.SelectedIndex = 0;
            }

            boxTyp.Items.Add("Kreditkartenkonto");
            boxTyp.Items.Add("Sparkonto");
            boxTyp.SelectedIndex = 0;
        }
示例#9
0
        public Descriptions(MainForm mainform, object settings)
        {
            InitializeComponent();
            _settings = (Properties.Settings)settings;
            parentForm = mainform;
            twitchWeb = parentForm.twitchWeb;
            sc2tv = parentForm.sc2tv;
            cybergame = parentForm.cybergame;
            ggChat = parentForm.ggChat;
            gohaweb = parentForm.gohaTVstream;

            if (sc2tv != null && sc2tv.LoggedIn)
            {
                sc2tvCol = new AutoCompleteStringCollection();
                sc2tvCol.AddRange(sc2tv.GameList.Select(v => v.Value).ToArray());
                textWebSourceSc2tvGame.Autocompletedata = sc2tvCol;
            }
            if (ggChat != null && ggChat.isLoggedIn)
            {
                ggCol = new AutoCompleteStringCollection();
                textWebSourceGGGame.Autocompletedata = ggCol;
                ggCol.AddRange(ggChat.GameList.Select(v => v.Value).ToArray());
            }
            if (twitchWeb != null)
            {
                twitchCol = new AutoCompleteStringCollection();
                twitchCol.AddRange(new string[]{});
                textWebSourceTwitchGame.Autocompletedata = twitchCol;
                
            }
            if (cybergame != null && cybergame.isLoggedIn)
            {
                cyberCol = new AutoCompleteStringCollection();
                cyberCol.AddRange(cybergame.GameList.ToList().Select(v => v.Value).ToArray());
                webAutocompleteCybergame.Autocompletedata = cyberCol;
            }
            textBoxProfile.Text = _settings.currentProfile;

        }
示例#10
0
 private void Settings_Load(object sender, EventArgs e)
 {
     var settings = new Properties.Settings();
     txtInstallDirectory.Text = settings.ChocolateyLibDirectory;
 }
示例#11
0
        //Acciones al cargar el formulario
        private void frmListas_Load(object sender, EventArgs e)
        {
            //Configuro según logged
            //Leo el looged
            Properties.Settings setting = new Properties.Settings(); //Creo variable para acceder a Settings y leer EmailAdmiin
            int logged = Convert.ToInt32(setting["logged"]);

            //pueblo los table adapters
            this.centroTableAdapter.Fill(correosDataSet.centro);
            this.listaTableAdapter.Fill(correosDataSet.lista);

            switch (logged)
            {
                case 1:
                    //Pueblo el CbxCentros
                    string estado = "";
                    for (int i = 0; i < this.correosDataSet.centro.Rows.Count; i++)
                    {
                        estado = this.correosDataSet.centro.Rows[i]["estado"].ToString(); //Evito inclusion de no sincronizados
                        if (estado == "") //Si está sincronizado el estado
                        {
                            this.cbxCentros.Items.Add(this.correosDataSet.centro.Rows[i]["nombre"]);
                        }

                    }
                    if (this.correosDataSet.centro.Rows.Count > 0)
                    {
                        this.cbxCentros.SelectedItem = this.correosDataSet.centro.Rows[0]["nombre"];
                    }

                    break;

                case 2:
                case 3:
                    string elCorreo = setting["Logon_User"].ToString();
                    correosDataSet.CentroListaByLoggedCorreoDataTableDataTable dstDataLogged = this.centroListaByLoggedCorreoDataTableTableAdapter.GetCentroListaByLoggedCorreo(elCorreo);

                        estado = dstDataLogged.Rows[0]["centro_estado"].ToString(); //Evito inclusion de no sincronizados
                        if (estado == "") //Si está sincronizado el estado
                        {
                            this.cbxCentros.Items.Add(dstDataLogged.Rows[0]["nombre_centro"].ToString()); //solo el primer centro que es el unico que tengo en el dst
                        }
                    this.cbxCentros.SelectedItem = dstDataLogged.Rows[0]["nombre_centro"].ToString();

                    //Oculto botones segun logged
                    this.btnBorrar.Visible = (logged < 3);
                    this.btnEditar.Visible = (logged < 3);
                    this.btnNueva.Visible = (logged < 3);

                    break;

            }

            //Terminé de cargar
        }
 private void QueryInstalledPackages()
 {
     var settings = new Properties.Settings();
     SearchPackages.Text = "";
     var expandedLibDirectory = System.Environment.ExpandEnvironmentVariables(settings.ChocolateyLibDirectory);
     if (!System.IO.Directory.Exists(expandedLibDirectory))
     {
         MessageBox.Show(string.Format(strings.lib_dir_not_found, expandedLibDirectory));
     }
     else
     {
         DisableUserInteraction();
         SetStatus(strings.getting_installed_packages);
         packageTabControl.SelectedTab = tabInstalled;
         lblProgressbar.Style = ProgressBarStyle.Marquee;
         PackageGrid.DataSource = new List<Package>();
         _packagesService.ListOfInstalledPackages();
     }
 }
示例#13
0
        //Clic en Aceptar
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            //Leyenda
            //1. Se usa para asunto de mensaje y guardarlo en Borrador cuando es llamado desde EditaMiembrosLista
            //2. Se usa para asunto de mensaje y guardarlo en Borrador cuando es llamado desde Listas

            //Gestiono segun para que me usan
            if (ctxAsunto.Text != "")
            {
                switch (ParaQueMeUsan)
                {
                    case 1: //Si se usa el form para un asunto de mensaje de Edita Miembros lista
                        string Asunto = ctxAsunto.Text;
                        //Obtengo la dirección de Email del buzón de comandos, si abrió una lista es porque la capa de permisos se lo permitió
                        Properties.Settings setting = new Properties.Settings(); //Creo variable para acceder a Settings y leer EmailAdmiin
                        string EmailDir = setting["Email_Admin"].ToString();
                        //Preparo y salvo el Email

                        //Preparo gestión de consecutivos y fabrico el subject
                        this.consecutivoTableAdapter.Fill(this.correosDataSet.consecutivo);
                        int? count = 0; //Para usar en el nuevo aleatorio
                        string consec = ""; //El consecutivo
                        do
                        {
                            consec = Globals.ThisAddIn.GeneraConsecutivo();
                            count = this.consecutivoTableAdapter.CuantosHay(consec);
                        } while (count > 0);
                        this.consecutivoTableAdapter.InserUnConsecutivo(consec);
                        this.consecutivoTableAdapter.Update(this.correosDataSet);
                        string EmailSubject = "enviar-correo" + "|" + consec + "|";

                        string preVacio = "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "____________________________________________" + "\n";
                        string EmailBody = preVacio + "|" + this.FormEditaMiebrosLista.Mi_IDLista.ToString() + "|" + Asunto + "|\n" + "____________________________________________" + "\n";
                        Globals.ThisAddIn.CreateEmailItemAndSave(EmailSubject, EmailDir, EmailBody);
                        MessageBox.Show("El mensaje ha sido guardado en la carpeta Borrador" + "\n" + "en espera de ser editado y enviado por usted", "¡Información!", MessageBoxButtons.OK);
                        this.Close();
                        break;

                    case 2: //Si se usa el form para un asunto de mensaje de lista
                        Asunto = ctxAsunto.Text;
                        //Tomo el id de lista
                        int LaLista = Convert.ToInt32(this.FormListas.dataGridViewListas.SelectedRows[0].Cells[0].Value);
                        //Obtengo la dirección de Email del buzón de comandos, si abrió una lista es porque la capa de permisos se lo permitió
                        setting = new Properties.Settings(); //Creo variable para acceder a Settings y leer EmailAdmiin
                        EmailDir = setting["Email_Admin"].ToString();
                        //Preparo y salvo el Email

                        //Preparo gestión de consecutivos y fabrico el subject
                        this.consecutivoTableAdapter.Fill(this.correosDataSet.consecutivo);
                        count = 0; //Para usar en el nuevo aleatorio
                        consec = ""; //El consecutivo
                        do
                        {
                            consec = Globals.ThisAddIn.GeneraConsecutivo();
                            count = this.consecutivoTableAdapter.CuantosHay(consec);
                        } while (count > 0);
                        this.consecutivoTableAdapter.InserUnConsecutivo(consec);
                        this.consecutivoTableAdapter.Update(this.correosDataSet);
                        EmailSubject = "enviar-correo" + "|" + consec + "|";

                        preVacio = "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "____________________________________________" + "\n";
                        EmailBody = preVacio +  "|" + LaLista.ToString() + "|" + Asunto + "|\n" + "____________________________________________" + "\n";
                        Globals.ThisAddIn.CreateEmailItemAndSave(EmailSubject, EmailDir, EmailBody);
                        MessageBox.Show("El mensaje ha sido guardado en la carpeta Borrador" + "\n" + "en espera de ser editado y enviado por usted", "¡Información!", MessageBoxButtons.OK);
                        this.Close();
                        break;
                    case 3: //Si se usa desde BadMail
                        Asunto = ctxAsunto.Text;
                        FormBadMail.EmailSubject = Asunto;
                        this.Close();
                        break;
                }
            }
        }
 private void installedPackagesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var settings = new Properties.Settings();
     if(!System.IO.Directory.Exists(settings.Installdirectory))
     {
         MessageBox.Show("Could not find the installed packages directory (" + settings.Installdirectory + "), please change the install directory in the settings.");
     }
     else
     {
         SetStatus("Getting list of installed packages");
         lblPackages.Text = "Installed packages";
         lblProgressbar.Style = ProgressBarStyle.Marquee;
         _packagesService.ListOfInstalledPackages();
     }
 }
示例#15
0
        public static void ShowEditMappingForm(KeyMapping km, bool useCapture)
        {
            AddEditMapping mf = new AddEditMapping(km, useCapture);

            Properties.Settings userSettings = new Properties.Settings();

            Point savedLocation = userSettings.EditMappingFormLocation;

            if (savedLocation.IsEmpty == false)
                mf.Location = savedLocation;
            else
                PositionChildForm(mf, ChildFormPosition.MiddleLeft);

            mf.ShowDialog(_mainForm);
        }
示例#16
0
        //Oppening del Menú contextual, permisos
        private void contextMenuStrip_Opening(object sender, CancelEventArgs e)
        {
            //Obtengo el looged
            Properties.Settings setting = new Properties.Settings();
            int logged = Convert.ToInt32(setting["logged"]);

            this.nuevaToolStripMenuItem.Visible = (logged < 3);
            this.editarMiembrosToolStripMenuItem.Visible = (logged < 3);
            this.editarNombreToolStripMenuItem.Visible = (logged < 3);
            this.borrarToolStripMenuItem.Visible = (logged < 3);
        }
示例#17
0
        private void LoadUserSettings()
        {
            Properties.Settings userSettings = new Properties.Settings();

            // As user.config is writeable (if you can find it!)
            // don't want to trust the settings.

            var firstrun = (userSettings.UserHasSavedSettings == false);
            var savedPosition = userSettings.KeyboardFormLocation;
            var savedWidth = userSettings.KeyboardFormWidth;

            hasNumberPad = userSettings.KeyboardFormHasNumberPad;
            isMacKeyboard = userSettings.KeyboardFormHasMacKeyboard;

            if (firstrun || savedPosition.IsEmpty || savedPosition.X == -32000)
            {
                FormsManager.PositionMainForm();
            }
            else
            {
                Location = savedPosition;
            }

            if (firstrun || savedWidth < MinimumSize.Width)
            {
                FormsManager.SizeMainForm();
            }
            else
            {
                Width = savedWidth;
            }
        }
示例#18
0
        private static void PositionColourEditorForm(ColourEditor ce)
        {
            // Now, where to put it..

            // TODO - Why is this value not being used?
            Point formLocation = GetColourEditorFormStartingPosition(ce);

            // If there are no other forms use the last closed position (if there is one)
            // (current form must be new and hasn't been added to collection yet)
            if (editorForms.Count == 0)
            {

                Properties.Settings userSettings = new Properties.Settings();
                Point savedLocation = userSettings.ColourEditorLocation;
                if (savedLocation == Point.Empty)
                {
                    // Colour Map form must be open as we must be spawning a new editor (as the count is zero)
                    formLocation = GetNewLocation(_colourMapForm, ce, ChildFormPosition.TopRight);
                }
                else
                {
                    formLocation = savedLocation;
                }
            }
            else
            {
                // There are 1-many forms open. They could be all over the screen:
                // pick the bottommost rightmost one and cascade off it
                // (Using top left means having to find the topleftmost form
                // that isn't cascaded,

                Point p = new Point(-5000, -5000);

                foreach (ColourEditor openform in editorForms.Values)
                {
                    if (openform == null || openform == ce)
                        continue;

                    if (openform.Location.X > p.X && openform.Location.Y > p.Y)
                        p = openform.Location;
                }

                formLocation = new Point(p.X + 10, p.Y + SystemInformation.CaptionHeight + 5);

            }

            ce.Location = formLocation;
        }
示例#19
0
 private void SaveSettings()
 {
     Properties.Settings userSettings = new Properties.Settings();
     userSettings.EditMappingFormLocation = Location;
     userSettings.Save();
 }
示例#20
0
        public static void ToggleMappingListForm()
        {
            if (_mapListForm == null)
            {

                Properties.Settings userSettings = new Properties.Settings();

                Point formLocation = userSettings.MappingListFormLocation;
                _mapListForm = new MappingListForm();

                // Load settings before positioning so we know how wide form is
                _mapListForm.LoadUserSettings();

                if (formLocation.IsEmpty)
                {
                    PositionMappingListForm();
                }
                else
                    _mapListForm.Location = formLocation;

                _mapListForm.FormClosed += ChildFormClosed;

                _mapListForm.Show(_mainForm);
            }
            else
            {
                _mapListForm.Close();
            }
        }
示例#21
0
        public static void ToggleColourMapForm()
        {
            if (_colourMapForm != null)
            {
                _colourMapForm.Close();
                return;
            }

            _colourMapForm = new ColourMap();

            Properties.Settings userSettings = new Properties.Settings();

            Point formLocation = userSettings.ColourListFormLocation;

            if (formLocation.IsEmpty)
            {
                PositionColourMapForm();
            }
            else
            {
                _colourMapForm.Location = formLocation;
            }

            _colourMapForm.FormClosed += ChildFormClosed;
            _colourMapForm.Show(_mainForm);
        }
示例#22
0
        public static void ShowHelpForm()
        {
            if (_helpForm == null)
            {
                _helpForm = new HelpForm();
                Properties.Settings userSettings = new Properties.Settings();
                Point formlocation = userSettings.HelpFormLocation;

                if (formlocation.IsEmpty)
                    PositionHelpForm(false);
                else
                    _helpForm.Location = formlocation;

                _helpForm.Show(_mainForm);
            }
        }
示例#23
0
        //Cuando cambia la seleccion en el CbxCentros
        public void cbxCentros_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                string item = "";
                item = (cbxCentros.SelectedItem != null) ? cbxCentros.SelectedItem.ToString() : ""; //Tomo la selección si no es nula
                if (item != "") //Me cuido de una mala selección
                {
                    Properties.Settings setting = new Properties.Settings(); //Creo variable para acceder a Settings y leer EmailAdmiin
                    int logged = Convert.ToInt32(setting["logged"]);
                    string elCorreo = setting["Logon_User"].ToString();

                    //Limpio  el grid
                    while (this.dataGridViewListas.Rows.Count > 0)
                    {
                        this.dataGridViewListas.Rows.RemoveAt(0);
                    }

                    //Configuro a código el DatataGridView
                            this.dataGridViewListas.Columns[0].Width = 50;
                            this.dataGridViewListas.Columns[0].HeaderText = "ID";
                            this.dataGridViewListas.Columns[1].Width = 300;
                            this.dataGridViewListas.Columns[1].HeaderText = "Nombre";
                            this.dataGridViewListas.Columns[2].Visible = false;
                            this.dataGridViewListas.Columns[3].Width = 100;
                            this.dataGridViewListas.Columns[3].HeaderText = "Estado";
                            this.dataGridViewListas.Columns[3].Name = "Estado";

                    switch (logged)
                    {
                        case 1: //Admins
                        case 2:
                            id_centro = Convert.ToInt32(this.centroTableAdapter.GetCentroByNombre(item).Rows[0]["id_centro"].ToString()); //Tomo el id de centro
                            //Pueblo el DataGridView

                            if (this.listaTableAdapter.ListasDeUnCentro(id_centro).Count > 0)
                            {
                                correosDataSet.listaDataTable dstLista;
                                dstLista = this.listaTableAdapter.ListasDeUnCentro(id_centro);
                                this.etListas.Text = dstLista.Count.ToString();
                                for (int i = 0; i < dstLista.Count; i++)
                                {
                                    if (dataGridViewListas.Rows.Count <= i) dataGridViewListas.Rows.Add();
                                    dataGridViewListas.Rows[i].Cells["ID"].Value = dstLista[i].id_lista.ToString();
                                    dataGridViewListas.Rows[i].Cells["Nombre"].Value = dstLista[i].nombre.ToString();
                                    dataGridViewListas.Rows[i].Cells["Estado"].Value = (dstLista[i].estado == null) ? "" : dstLista[i].estado.ToString();
                                }
                            }

                            break;

                        case 3:
                            correosDataSet.CentroListaByLoggedCorreoDataTableDataTable dstDataLogged = this.centroListaByLoggedCorreoDataTableTableAdapter.GetCentroListaByLoggedCorreo(elCorreo);
                            this.dataGridViewListas.DataSource = null; //Reseteo el dataSource, voy a llenar el grid a mano
                            if (dstDataLogged.Count > 0)
                            {
                                this.etListas.Text = dstDataLogged.Count.ToString();
                                for (int i = 0; i < dstDataLogged.Count; i++)
                                {
                                    if (dataGridViewListas.Rows.Count <= i) dataGridViewListas.Rows.Add();
                                    dataGridViewListas.Rows[i].Cells["ID"].Value = dstDataLogged[i].id_lista.ToString();
                                    dataGridViewListas.Rows[i].Cells["Nombre"].Value = dstDataLogged[i].nombre_lista.ToString();
                                    dataGridViewListas.Rows[i].Cells["Estado"].Value = (dstDataLogged[i].lista_estado == null) ? "" : dstDataLogged[i].lista_estado.ToString();
                                }
                            }

                            break;
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#24
0
 private void SaveSettings()
 {
     Properties.Settings userSettings = new Properties.Settings();
     userSettings.ColourListFormLocation = Location;
     userSettings.ColourMapShowAllButtons = _showAllButtons;
     userSettings.Save();
 }
示例#25
0
 public UpdaterDialog()
 {
     InitializeComponent();
     this.settings = Properties.Settings.Default;
 }
示例#26
0
        private void LoadUserSettings()
        {
            Properties.Settings userSettings = new Properties.Settings();

            // As user.config is writeable (if you can find it!)
            // don't want to trust the settings.

            bool firstrun = true;
            Point savedPosition = Point.Empty;
            int savedWidth = 0;
            MappingFilter oldFilter = MappingFilter.All;

            firstrun = (userSettings.UserHasSavedSettings == false);
            savedPosition = userSettings.KeyboardFormLocation;
            savedWidth = userSettings.KeyboardFormWidth;

            _hasNumberPad = userSettings.KeyboardFormHasNumberPad;
            _isMacKeyboard = userSettings.KeyboardFormHasMacKeyboard;
            oldFilter = (MappingFilter)userSettings.LastMappingsFilter;

            //if (firstrun == false)
            //{
            //    // AppController.SwitchKeyboardLayout((KeyboardLayoutType)userSettings.KeyboardLayout);
            //}

            if (firstrun || savedPosition.IsEmpty || savedPosition.X == -32000)
                FormsManager.PositionMainForm();
            else
                this.Location = savedPosition;

            if (firstrun || savedWidth < this.MinimumSize.Width)
            {
                FormsManager.SizeMainForm();
            }
            else
            {
                this.Width = savedWidth;
            }


            // If there are boot mappings and no user mappings and the last view mode was boot, then
            // start in boot mode - as long as user has the rights to change them (or is running Vista)

            if (oldFilter == MappingFilter.Boot
                && MappingsManager.GetMappingCount(MappingFilter.Boot) > 0
                && MappingsManager.GetMappingCount(MappingFilter.User) == 0
                && (AppController.UserCanWriteBootMappings || operatingSystemCapability.ImplementsUAC))
            {
                MappingsManager.SetFilter(MappingFilter.Boot);
            }
        }
示例#27
0
        private void SaveUserSettings()
        {
            Properties.Settings userSettings = new Properties.Settings
            {
                KeyboardFormLocation = Location,
                KeyboardFormWidth = Width,
                KeyboardFormHasNumberPad = hasNumberPad,
                KeyboardFormHasMacKeyboard = isMacKeyboard,
                ColourMapFormOpen = FormsManager.IsColourMapFormOpen(),
                MappingListFormOpen = FormsManager.IsMappingListFormOpen(),
                UserHasSavedSettings = true
            };

            // userSettings.KeyboardLayout = (int)AppController.KeyboardLayout;
            userSettings.Save();
        }
示例#28
0
        public static void OpenChildForms()
        {
            Properties.Settings userSettings = new Properties.Settings();

            if (userSettings.ColourMapFormOpen)
                ToggleColourMapForm();

            if (userSettings.MappingListFormOpen)
                ToggleMappingListForm();

            if (userSettings.ShowHelpFormAtStartup)
            {
                ShowHelpForm();
            }
        }
示例#29
0
 private void SaveUserSettings()
 {
     Properties.Settings userSettings = new Properties.Settings();
     userSettings.ColourEditorLocation = Location;
     userSettings.Save();
 }
示例#30
0
        void SaveUserSettings()
        {
            Properties.Settings userSettings = new Properties.Settings
                {
                    KeyboardFormLocation = this.Location,
                    KeyboardFormWidth = this.Width,
                    KeyboardFormHasNumberPad = this._hasNumberPad,
                    KeyboardFormHasMacKeyboard = this._isMacKeyboard,
                    ColourMapFormOpen = FormsManager.IsColourMapFormOpen(),
                    MappingListFormOpen = FormsManager.IsMappingListFormOpen(),
                    LastMappingsFilter = (int)MappingsManager.Filter,
                    UserHasSavedSettings = true
                };

            // userSettings.KeyboardLayout = (int)AppController.KeyboardLayout;
            userSettings.Save();
        }