示例#1
0
		private bool SaveDocument(DockContent document) {
			if (_project == null) {
				return true;
			}

			MetadataFile.SuspendFileSystemWatching();
			try
			{
				if (document != null) 
				{
					if (document is ObjectEditorForm) 
					{
						((ObjectEditorForm) document).ObjectEditor.CommitChanges();
					}
					else 
					{
						Debug.WriteLine(
							"WARNING: Document could not be saved because it is not of the type 'ObjectEditorForm'. System type of document content is: " + document.GetType().FullName);
						return false;
					}
				}
			}
			finally
			{
				MetadataFile.ResumeFileSystemWatching();
			}
			return true;
		}