// Gets called to create the UI context. It can be shared by any IFileTabContent in this tab. // Eg. there's only one text editor per tab, shared by all IFileTabContents that need a text // editor. public override DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) { // This custom view object is shared by all nodes of the same type. If we didn't want it // to be shared, we could use 'node' or 'this' as the key. var key = node.GetType(); // var key = node; // uncomment to not share it // If the UI object has already been created, use it, else create it. The object is // stored in a weak reference unless you use the other method override. return locator.Get(key, () => new AssemblyChildNodeUIContext()); }
public TabContentImpl(DocumentTabService documentTabService, IDocumentTabUIContextLocator documentTabUIContextLocator, Lazy <IReferenceDocumentTabContentProvider, IReferenceDocumentTabContentProviderMetadata>[] referenceDocumentTabContentProviders, Lazy <IDefaultDocumentTabContentProvider, IDefaultDocumentTabContentProviderMetadata>[] defaultDocumentTabContentProviders) { this.elementZoomer = new TabElementZoomer(); this.tabHistory = new TabHistory(); this.tabHistory.SetCurrent(new NullDocumentTabContent(), false); this.documentTabService = documentTabService; this.documentTabUIContextLocator = documentTabUIContextLocator; this.referenceDocumentTabContentProviders = referenceDocumentTabContentProviders; this.defaultDocumentTabContentProviders = defaultDocumentTabContentProviders; this.uiContext = new NullDocumentTabUIContext(); this.uiObject = this.uiContext.UIObject; }
// Gets called to create the UI context. It can be shared by any IFileTabContent in this tab. // Eg. there's only one text editor per tab, shared by all IFileTabContents that need a text // editor. public override DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) { // This custom view object is shared by all nodes of the same type. If we didn't want it // to be shared, we could use 'node' or 'this' as the key. var key = node.GetType(); // var key = node; // uncomment to not share it // If the UI object has already been created, use it, else create it. The object is // stored in a weak reference unless you use the other method override. return(locator.Get(key, () => new AssemblyChildNodeUIContext())); }
public override DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) => locator.Get(hexNode, () => new HexDocumentTabUIContext(hexNode.VMObject, hexNode.IsVirtualizingCollectionVM));
public IDocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) => locator.Get <IDocumentViewer>();
public override DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) => (DocumentTabUIContext)locator.Get <IDocumentViewer>();
public override DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) => locator.Get(typeof(NullDocumentTabUIContext), () => new NullDocumentTabUIContext());
public override DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) => locator.Get(buffer, useStrongReference: true, creator: () => new HexViewDocumentTabUIContext(hexEditorGroupFactoryService.Value, buffer));
public override DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) => locator.Get(hexDocument, () => new HexBoxDocumentTabUIContext(hexDocument, menuService, hexEditorSettings, appSettings, hexBoxUndoService.Value));
/// <summary> /// Creates the <see cref="DocumentTabUIContext"/> instance needed by this instance. This /// instance will only be used in this tab. /// </summary> /// <param name="locator">Can be used to get a per-tab shared instance</param> /// <returns></returns> public abstract DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator);
public override DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) { return(new ControlFlowGraphTabUiContext(graphProvider, theme, font)); }
public TabContentImpl(DocumentTabService documentTabService, IDocumentTabUIContextLocator documentTabUIContextLocator, Lazy<IReferenceDocumentTabContentProvider, IReferenceDocumentTabContentProviderMetadata>[] referenceDocumentTabContentProviders, Lazy<IDefaultDocumentTabContentProvider, IDefaultDocumentTabContentProviderMetadata>[] defaultDocumentTabContentProviders, Lazy<IReferenceHandler, IReferenceHandlerMetadata>[] referenceHandlers) { elementZoomer = new TabElementZoomer(); tabHistory = new TabHistory(); tabHistory.SetCurrent(new NullDocumentTabContent(), false); this.documentTabService = documentTabService; this.documentTabUIContextLocator = documentTabUIContextLocator; this.referenceDocumentTabContentProviders = referenceDocumentTabContentProviders; this.defaultDocumentTabContentProviders = defaultDocumentTabContentProviders; this.referenceHandlers = referenceHandlers; uiContext = new NullDocumentTabUIContext(); uiObject = uiContext.UIObject; }
public override DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) => (DocumentTabUIContext)locator.Get<IDocumentViewer>();