Vixen
feb85697
csharp
public interface IDocumentHost

Which kind opens a file, and the one place an asset becomes an open document.

Read the guide page for this →

Remarks

Doc 50 § D4's Documents half. TryOpen resolves the kind; the Workspace's IWorkspace.Show resolves the view. A module reaches it with Require<IDocumentHost>() to claim an extension or to hear a document open.

Told, never discovered — the same rule, and the same reasons, as ImporterRegistry. An assembly scan makes "which kinds does this build have" a question with a different answer in a trimmed publish, and two kinds claiming one extension resolve by load order, which is how a .vxprefab comes to open in the scene editor on one machine and the prefab editor on another.

There is no fallback. A file nothing claims stays selected in the browser and its import settings are still inspectable, which is what the inspector panel is for.

Fields and properties (1)

  • IReadOnlyCollection<DocumentKind> Kinds

    Everything registered, in no particular order.

Events (1)

  • Action<EditorDocument>? Opened

    Raised once for each document this host opens, after it is fully built.

Methods (4)

  • IDisposable Add(DocumentKind kind)

    Registers a kind, and hands back the removal.

  • bool TryGetForFile(string path, out DocumentKind? kind)

    Finds the kind for a file.

  • bool TryGetByName(string name, out DocumentKind? kind)

    Finds a kind by name.

  • bool TryOpen(AssetId asset, out EditorDocument? opened)

    Opens an asset, or brings the document already editing it forward.

Used by (15)

  • AssetEditorsModuleVixen.Editor.AssetEditors
  • AssetEditorsModuleReachTestsVixen.Editor.App.Tests
  • DocumentHostVixen.Editor.Core
  • DocumentHostTestsVixen.Editor.AssetEditors.Tests
  • DocumentPairingTestsVixen.Editor.App.Tests
  • EditorAddingModuleVixen.Editor.AssetEditors.Tests
  • EditorApplicationVixen.Editor.App
  • EditorCombinatorPairTestsVixen.Editor.App.Tests
  • HalfModuleVixen.Editor.App.Tests
  • LibraryModuleTestsVixen.Editor.App.Tests
  • OutOfTreePluginTestsVixen.Editor.App.Tests
  • ServiceReachTestsVixen.Editor.App.Tests
  • StandardEditorsVixen.Editor.AssetEditors
  • TexturingFixtureVixen.Editor.Texturing.Tests
  • TexturingModuleVixen.Editor.Texturing