コード例 #1
0
ファイル: MainForm.cs プロジェクト: palfrey/ndoc
		private void menuViewOptions_Click(object sender, System.EventArgs e)
		{
			using( OptionsForm optionsForm = new OptionsForm( (NDocOptions)this.options.Clone() ) )
			{
				if ( optionsForm.ShowDialog() == DialogResult.OK )
				{
					this.options = optionsForm.Options;

					// save the user settings
					using( Settings settings = new Settings( Settings.UserSettingsFile ) )
					{
						settings.SetSetting( "gui", "loadLastProjectOnStart", this.options.LoadLastProjectOnStart );
						settings.SetSetting( "gui", "showProgressOnBuild", this.options.ShowProgressOnBuild );
						settings.SetSetting( "gui", "mruSize", this.options.MRUSize );
					}

					// save machine settings
					using( Settings settings = new Settings( Settings.MachineSettingsFile ) )
					{
						settings.SetSetting( "compilers", "htmlHelpWorkshopLocation", this.options.HtmlHelpWorkshopLocation );
					}
				}
			}
		}
コード例 #2
0
ファイル: MainForm.cs プロジェクト: tgassner/NDoc
		private void FileSave(string fileName)
		{
			try
			{
				project.Write( fileName );
				using ( Settings settings = new Settings( Settings.UserSettingsFile ) )
					settings.SetSetting( "gui", "lastSaveDirectory", Path.GetDirectoryName( fileName ) );

				SetWindowTitle();
			}
			catch (Exception ex)
			{
				MessageBox.Show(this, ex.InnerException.Message, "Save", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				FileSaveAs();
			}
		}
コード例 #3
0
ファイル: MainForm.cs プロジェクト: palfrey/ndoc
		/// <summary>Writes out the NDoc configuration file to the
		/// application directory.</summary>
		/// <remarks>The config file stores the most recently used (MRU)
		/// list of project files.  It also stores which documenter was
		/// being used last.</remarks>
		private void WriteConfig()
		{			
			using( Settings settings = new Settings( Settings.UserSettingsFile ) )
			{
				if ( this.WindowState == FormWindowState.Maximized )
				{
					settings.SetSetting( "gui", "maximized", true );
				}
				else if ( this.WindowState == FormWindowState.Normal )
				{
					settings.SetSetting( "gui", "maximized", false );
					settings.SetSetting( "gui", "location", this.Location );
					settings.SetSetting( "gui", "size", this.Size );
				}
				settings.SetSetting( "gui", "viewTrace", this.traceWindow1.Visible );
				settings.SetSetting( "gui", "traceWindowHeight", this.traceWindow1.Height );
				settings.SetSetting( "gui", "statusBar", this.statusBar.Visible );
				settings.SetSetting( "gui", "showDescriptions", this.ShowDescriptions );
				
				if ( comboBoxDocumenters.SelectedIndex >= 0 )
					settings.SetSetting( "gui", "documenter", ((IDocumenter)project.Documenters[comboBoxDocumenters.SelectedIndex]).Name );

				// Trim our MRU list down to max amount before writing the config.
				while (recentProjectFilenames.Count > this.options.MRUSize)
					recentProjectFilenames.RemoveAt(this.options.MRUSize);

				settings.SetSettingList( "gui", "mru", "project", recentProjectFilenames );			
			}
		}
コード例 #4
0
ファイル: MainForm.cs プロジェクト: tgassner/NDoc
		/// <summary>Writes out the NDoc configuration file to the
		/// application directory.</summary>
		/// <remarks>The config file stores the most recently used (MRU)
		/// list of project files.  It also stores which documenter was
		/// being used last.</remarks>
		private void WriteConfig()
		{			
			using( Settings settings = new Settings( Settings.UserSettingsFile ) )
			{
				if ( this.WindowState == FormWindowState.Maximized )
				{
					settings.SetSetting( "gui", "maximized", true );
				}
				else if ( this.WindowState == FormWindowState.Normal )
				{
					settings.SetSetting( "gui", "maximized", false );
					settings.SetSetting( "gui", "location", this.Location );
					settings.SetSetting( "gui", "size", this.Size );
				}
				settings.SetSetting( "gui", "viewTrace", this.traceWindow1.Visible );
				settings.SetSetting( "gui", "traceWindowHeight", this.traceWindow1.Height );
				settings.SetSetting( "gui", "statusBar", this.statusBar.Visible );
				settings.SetSetting( "gui", "showDescriptions", this.ShowDescriptions );
				settings.SetSetting( "gui", "detailedAssemblyView", this.assemblyListControl.DetailsView );

				if ( project.ActiveDocumenter != null )
					settings.SetSetting( "gui", "documenter", project.ActiveDocumenter.Name );

				// Trim our MRU list down to max amount before writing the config.
				while (recentProjectFilenames.Count > this.options.MRUSize)
					recentProjectFilenames.RemoveAt(this.options.MRUSize);

                settings.SetSettingList("gui", "mru", "project", recentProjectFilenames);			
			}
		}