NClass.Core.Project.Save C# (CSharp) Method

Save() public method

/// Could not save the project. /// /// The project was not saved before by the method. ///
public Save ( ) : void
return void
		public void Save()
		{
			if (projectFile == null)
				throw new InvalidOperationException(Strings.ErrorCannotSaveFile);

			Save(FilePath);
		}

Same methods

Project::Save ( string fileName ) : void

Usage Example

コード例 #1
0
ファイル: Workspace.cs プロジェクト: gbaychev/NClass
		/// <exception cref="ArgumentNullException">
		/// <paramref name="project"/> is null.
		/// </exception>
		public bool SaveProjectAs(Project project)
		{
			if (project == null)
				throw new ArgumentNullException("project");

			using (SaveFileDialog dialog = new SaveFileDialog())
			{
				dialog.FileName = project.Name;
				dialog.InitialDirectory = project.GetProjectDirectory();
				dialog.Filter = Strings.NClassProjectFiles + " (*.ncp)|*.ncp";

				if (dialog.ShowDialog() == DialogResult.OK)
				{
					try
					{
						project.Save(dialog.FileName);
						Settings.Default.AddRecentFile(project.FilePath);
						return true;
					}
					catch (Exception ex)
					{
						MessageBox.Show(Strings.Error + ": " + ex.Message,
							Strings.SaveAs, MessageBoxButtons.OK, MessageBoxIcon.Error);
					}
				}
				return false;
			}
		}
All Usage Examples Of NClass.Core.Project::Save