public static void Unresolve(IAdaptable gameNode) { var game = gameNode.As <Game.GameExtensions>(); if (game == null) { return; } var placementsFolder = game.PlacementsFolder; if (placementsFolder != null) { foreach (var cell in placementsFolder.Cells) { cell.Unresolve(); } } // Detach all children // This will cause the native adapters to destroy the associated native objects. foreach (var c in game.DomNode.Children) { c.RemoveFromParent(); } }
public static void ResolveOnLoad(IAdaptable gameNode) { var game = gameNode.As <Game.GameExtensions>(); if (game == null) { return; } var placementsFolder = game.PlacementsFolder; if (placementsFolder != null) { foreach (var cell in placementsFolder.Cells) { cell.Resolve(); } } }
public static void SelectNameForReferencedDocuments(IAdaptable gameNode) { var game = gameNode.As <Game.GameExtensions>(); if (game == null) { return; } var placementsFolder = game.PlacementsFolder; if (placementsFolder != null) { foreach (var cellRef in placementsFolder.Cells) { cellRef.SelectNameIfNecessary(); } } }
public static void SaveReferencedDocuments(IAdaptable gameNode, ISchemaLoader schemaLoader) { var game = gameNode.As <Game.GameExtensions>(); if (game == null) { return; } var placementsFolder = game.PlacementsFolder; if (placementsFolder != null) { foreach (var cellRef in placementsFolder.Cells) { var doc = cellRef.Target; if (doc == null) { continue; } doc.Save(cellRef.Uri, schemaLoader); } } }
/// <summary> /// Adapts a <see cref="IReferencesNode"/> to a VsLang <see cref="References"/>. /// </summary> /// <returns>The <see cref="References"/> or <see langword="null"/> if conversion is not possible.</returns> public static References AsReferences(this IAdaptable <IReferencesNode> adaptable) { return(adaptable.As <References>()); }
/// <summary> /// Adapts a <see cref="Project"/> to an <see cref="IVsProject"/>. /// </summary> /// <returns>The <see cref="IVsProject"/> or <see langword="null"/> if conversion is not possible.</returns> public static IVsProject AsVsProject(this IAdaptable <Project> adaptable) { return(adaptable.As <IVsProject>()); }
/// <summary> /// Adapts a <see cref="Solution"/> to an <see cref="ISolutionNode"/>. /// </summary> /// <returns>The <see cref="ISolutionNode"/> or <see langword="null"/> if conversion is not possible.</returns> public static ISolutionNode AsSolutionNode(this IAdaptable <Solution> adaptable) { return(adaptable.As <ISolutionNode>()); }
/// <summary> /// Adapts a <see cref="Reference"/> to an <see cref="IReferenceNode"/>. /// </summary> /// <returns>The <see cref="IReferenceNode"/> or <see langword="null"/> if conversion is not possible.</returns> public static IReferenceNode AsReferenceNode(this IAdaptable <Reference> adaptable) { return(adaptable.As <IReferenceNode>()); }
/// <summary> /// Adapts a <see cref="ProjectItem"/> to an <see cref="IItemNode"/>. /// </summary> /// <returns>The <see cref="IItemNode"/> or <see langword="null"/> if conversion is not possible.</returns> public static IItemNode AsItemNode(this IAdaptable <ProjectItem> adaptable) { return(adaptable.As <IItemNode>()); }
public static void Unresolve(IAdaptable gameNode) { var game = gameNode.As<Game.GameExtensions>(); if (game == null) return; var placementsFolder = game.PlacementsFolder; if (placementsFolder != null) { foreach (var cell in placementsFolder.Cells) { cell.Unresolve(); } } // Detach all children // This will cause the native adapters to destroy the associated native objects. foreach (var c in game.DomNode.Children) c.RemoveFromParent(); }
public static void SelectNameForReferencedDocuments(IAdaptable gameNode) { var game = gameNode.As<Game.GameExtensions>(); if (game == null) return; var placementsFolder = game.PlacementsFolder; if (placementsFolder != null) foreach (var cellRef in placementsFolder.Cells) cellRef.SelectNameIfNecessary(); }
public static void SaveReferencedDocuments(IAdaptable gameNode, ISchemaLoader schemaLoader) { var game = gameNode.As<Game.GameExtensions>(); if (game == null) return; var placementsFolder = game.PlacementsFolder; if (placementsFolder != null) { foreach (var cellRef in placementsFolder.Cells) { var doc = cellRef.Target; if (doc == null) continue; doc.Save(cellRef.Uri, schemaLoader); } } }
public static void ResolveOnLoad(IAdaptable gameNode) { var game = gameNode.As<Game.GameExtensions>(); if (game == null) return; var placementsFolder = game.PlacementsFolder; if (placementsFolder != null) { foreach (var cell in placementsFolder.Cells) { cell.Resolve(); } } }
/// <summary> /// Adapts a <see cref="IProjectNode"/> to a <see cref="VSProject"/>. /// </summary> /// <returns>The <see cref="VSProject"/> or <see langword="null"/> if conversion is not possible.</returns> public static VSProject AsVsLangProject(this IAdaptable <IProjectNode> adaptable) { return(adaptable.As <VSProject>()); }
/// <summary> /// Adapts a <see cref="ISolutionNode"/> to an <see cref="IVsSolution"/>. /// </summary> /// <returns>The <see cref="IVsSolution"/> or <see langword="null"/> if conversion is not possible.</returns> public static IVsSolution AsVsSolution(this IAdaptable <ISolutionNode> adaptable) { return(adaptable.As <IVsSolution>()); }
/// <summary> /// Adapts a <see cref="ISolutionNode"/> to a DTE <see cref="EnvDTE.Solution"/>. /// </summary> /// <returns>The DTE <see cref="Solution"/> or <see langword="null"/> if conversion is not possible.</returns> public static EnvDTE.Solution AsSolutionNode(this IAdaptable <ISolutionNode> adaptable) { return(adaptable.As <EnvDTE.Solution>()); }
/// <summary> /// Sets the attribute of the adapted DomNode to reference a new DomNode</summary> /// <param name="attributeInfo">Metadata to indicate which attribute to set</param> /// <param name="value">Any IAdaptable, such as DomNodeAdapter, DomNode, or IAdapter</param> protected void SetReference(AttributeInfo attributeInfo, IAdaptable value) { DomNode refNode = value.As <DomNode>(); DomNode.SetAttribute(attributeInfo, refNode); }
/// <summary> /// Sets the child of our adapted DomNode to a new DomNode</summary> /// <param name="childInfo">Metadata to indicate the child</param> /// <param name="value">Any IAdaptable, such as DomNodeAdapter, DomNode, or IAdapter</param> protected void SetChild(ChildInfo childInfo, IAdaptable value) { DomNode child = value.As <DomNode>(); DomNode.SetChild(childInfo, child); }
/// <summary> /// Adapts a <see cref="ProjectItem"/> to a <see cref="Microsoft.Build.Evaluation.ProjectItem"/>. /// </summary> /// <returns>The <see cref="Microsoft.Build.Evaluation.ProjectItem"/> or <see langword="null"/> if conversion is not possible.</returns> public static Microsoft.Build.Evaluation.ProjectItem AsMsBuildItem(this IAdaptable <ProjectItem> adaptable) { return(adaptable.As <Microsoft.Build.Evaluation.ProjectItem>()); }
/// <summary> /// Adapts a <see cref="VsHierarchyItem"/> to an <see cref="ISolutionNode"/>. /// </summary> /// <returns>The <see cref="ISolutionNode"/> or <see langword="null"/> if conversion is not possible.</returns> public static ISolutionNode AsSolutionNode(this IAdaptable <VsHierarchyItem> adaptable) { return(adaptable.As <ISolutionNode>()); }
/// <summary> /// Adapts a <see cref="References"/> to an <see cref="IReferencesNode"/>. /// </summary> /// <returns>The <see cref="IReferencesNode"/> or <see langword="null"/> if conversion is not possible.</returns> public static IReferencesNode AsItemNode(this IAdaptable <References> adaptable) { return(adaptable.As <IReferencesNode>()); }
/// <summary> /// Adapts a <see cref="VsHierarchyItem"/> to an <see cref="IProjectNode"/>. /// </summary> /// <returns>The <see cref="IProjectNode"/> or <see langword="null"/> if conversion is not possible.</returns> public static IProjectNode AsProjectNode(this IAdaptable <VsHierarchyItem> adaptable) { return(adaptable.As <IProjectNode>()); }
/// <summary> /// Adapts a <see cref="Project"/> to an <see cref="IProjectNode"/>. /// </summary> /// <returns>The <see cref="IProjectNode"/> or <see langword="null"/> if conversion is not possible.</returns> public static IProjectNode AsProjectNode(this IAdaptable <Project> adaptable) { return(adaptable.As <IProjectNode>()); }
/// <summary> /// Adapts a <see cref="VsHierarchyItem"/> to an <see cref="IItemNode"/>. /// </summary> /// <returns>The <see cref="IItemNode"/> or <see langword="null"/> if conversion is not possible.</returns> public static IItemNode AsItemNode(this IAdaptable <VsHierarchyItem> adaptable) { return(adaptable.As <IItemNode>()); }
/// <summary> /// Adapts a <see cref="Project"/> to a <see cref="Microsoft.Build.Evaluation.Project"/>. /// </summary> /// <returns>The <see cref="Microsoft.Build.Evaluation.Project"/> or <see langword="null"/> if conversion is not possible.</returns> public static Microsoft.Build.Evaluation.Project AsMsBuildProject(this IAdaptable <Project> adaptable) { return(adaptable.As <Microsoft.Build.Evaluation.Project>()); }
/// <summary> /// Adapts a <see cref="IItemNode"/> to an <see cref="VSProjectItem"/>. /// </summary> /// <returns>The <see cref="VSProjectItem"/> or <see langword="null"/> if conversion is not possible.</returns> public static VSProjectItem AsVsLangItem(this IAdaptable <IItemNode> adaptable) { return(adaptable.As <VSProjectItem>()); }