Vixen
02b45cc4
csharp
public abstract class EditorDocument

One thing open for editing, with its own undo history.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A scene, a material, a prefab, a settings asset. What it holds and how it writes itself back are the deriving type's business; what is here is the part every open document has — a title, an undo stack, and an honest answer to whether it differs from disk.

Dirty has two sources. The stack's own position covers the edits made in this document. The other is a change that arrived from outside it — a global rename that rewrote a reference this document holds — which no amount of undoing inside the document can take back, so it is tracked separately and only Save clears it.

Fields and properties (7)

  • public EditorProject Project

    The project it belongs to.

  • public EditorContext Context

    What commands on this document's stack are handed.

  • public CommandStack Stack

    This document's undo history.

  • public AssetId Asset

    The asset it edits, or Empty for one not saved anywhere yet.

  • public IReadOnlySignal<string> Title

    What the tab says.

  • public IReadOnlySignal<bool> IsDirty

    Whether it differs from what is on disk.

  • public bool IsOpen

    Whether it is still open in the project.

Events (1)

  • public Action<EditorDocument>? Saved

    Raised after the document has written itself back, before it is marked clean.

Methods (6)

  • protected EditorDocument(EditorProject project, AssetId asset, string title)

    Opens a document in a project.

  • public void SetTitle(string value)

    Changes what the tab says.

  • public void Save()

    Writes it back and records that this is now what is on disk.

  • public bool Close()

    Closes it, which is Close on this document.

  • protected abstract void SaveCore()

    Writes the document back to wherever it came from.

  • protected internal virtual void OnClosed()

    Called once when the document leaves the project.

Used by (168, showing 40)

  • AddCommentCommandVixen.Editor.NodeGraph
  • AddGroupCommandVixen.Editor.NodeGraph
  • AddNodeCommandVixen.Editor.NodeGraph
  • AddressableGroupDocumentVixen.Editor.AssetEditors
  • AddressableGroupDocumentTestsVixen.Editor.AssetEditors.Tests
  • AddressableGroupEditorFactoryVixen.Editor.AssetEditors
  • AddressableGroupsViewVixen.Editor.AssetEditors
  • AnimationBinderVixen.Editor.AssetEditors
  • AnimationClipDocumentVixen.Editor.AssetEditors
  • AnimationClipEditorFactoryVixen.Editor.AssetEditors
  • AnimationGraphDocumentVixen.Editor.AssetEditors
  • AnimationGraphEditorFactoryVixen.Editor.AssetEditors
  • AnimationWiringTestsVixen.Editor.App.Tests
  • AssetEditorRegistryVixen.Editor.AssetEditors
  • AssetEditorRegistryTestsVixen.Editor.AssetEditors.Tests
  • AssetPickerTestsVixen.Editor.App.Tests
  • AudioMixerDocumentVixen.Editor.AssetEditors
  • AudioMixerEditorFactoryVixen.Editor.AssetEditors
  • AuthoringContextTestsVixen.Editor.AssetEditors.Tests
  • AuthoringTestsVixen.Editor.AssetEditors.Tests
  • BlockoutBooleanVixen.Editor.Blockout
  • BlockoutBooleanTestsVixen.Editor.Blockout.Tests
  • BlockoutCreateVixen.Editor.Blockout
  • BlockoutCreateTestsVixen.Editor.Blockout.Tests
  • BlockoutCubeGridVixen.Editor.Blockout
  • BlockoutGeometryVixen.Editor.Blockout
  • BlockoutGeometryTestsVixen.Editor.Blockout.Tests
  • BlockoutHandoffVixen.Editor.Blockout
  • BlockoutHistoryTestsVixen.Editor.Blockout.Tests
  • BlockoutSurfaceTestsVixen.Editor.Blockout.Tests
  • BlockoutSurfacesVixen.Editor.Blockout
  • ClashingFactoryVixen.Editor.AssetEditors.Tests
  • ClosingTestsVixen.Editor.App.Tests
  • CodeDocumentVixen.Editor.AssetEditors
  • CodeDocumentTestsVixen.Editor.AssetEditors.Tests
  • CommandStackVixen.Editor.Core
  • CommandStackPropertyTestsVixen.Editor.Core.Tests
  • CommandStackTestsVixen.Editor.Core.Tests
  • CommandTestsVixen.Editor.NodeGraph.Tests
  • ComponentTestsVixen.Editor.App.Tests