/// <summary> /// Ru: Сохраняет изменения в активном(который в фокусе) редакторе /// En: Save changes in active (focused) editor /// </summary> public void SaveActiveEditor() { if ((DockPanel.ActiveContent.GetType() == typeof(PKStudio.Forms.Editors.SourceFileEditor)) || (DockPanel.ActiveContent.GetType() == typeof(PKStudio.Forms.Editors.LibraryCategoryEditor)) || (DockPanel.ActiveContent.GetType() == typeof(PKStudio.Forms.Editors.LibraryEditor)) || (DockPanel.ActiveContent.GetType() == typeof(PKStudio.Forms.Editors.FeatureEditor)) ) { PKStudio.Forms.BaseForms.EditorBaseForm editor = (PKStudio.Forms.BaseForms.EditorBaseForm)DockPanel.ActiveContent; if (editor.Modified) { editor.Save(); } } }
/// <summary> /// Ru: Сохранить все изменения /// En: Save all changes /// </summary> public void SaveAllModifiedEditors() { foreach (DockContent item in DockPanel.Contents) { if ((item.GetType() == typeof(PKStudio.Forms.Editors.SourceFileEditor)) || (item.GetType() == typeof(PKStudio.Forms.Editors.LibraryCategoryEditor)) || (item.GetType() == typeof(PKStudio.Forms.Editors.LibraryEditor)) || (item.GetType() == typeof(PKStudio.Forms.Editors.FeatureEditor)) ) { PKStudio.Forms.BaseForms.EditorBaseForm editor = (PKStudio.Forms.BaseForms.EditorBaseForm)item; editor.Save(); } } }