예제 #1
0
        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();
            }
        }
예제 #2
0
        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();
                }
            }
        }
예제 #3
0
        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();
                }
            }
        }
예제 #4
0
        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);
                }
            }
        }
예제 #5
0
 /// <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>());
 }
예제 #6
0
 /// <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>());
 }
예제 #7
0
 /// <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>());
 }
예제 #8
0
 /// <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>());
 }
예제 #9
0
 /// <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>());
 }
예제 #10
0
파일: Patches.cs 프로젝트: ldh9451/XLE
        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();
        }
예제 #11
0
파일: Patches.cs 프로젝트: ldh9451/XLE
        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();
        }
예제 #12
0
파일: Patches.cs 프로젝트: ldh9451/XLE
        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);
                }
            }
        }
예제 #13
0
파일: Patches.cs 프로젝트: ldh9451/XLE
        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();
                }
            }
        }
예제 #14
0
 /// <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>());
 }
예제 #15
0
 /// <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>());
 }
예제 #16
0
 /// <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>());
 }
예제 #17
0
        /// <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);
        }
예제 #18
0
        /// <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);
        }
예제 #19
0
 /// <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>());
 }
예제 #20
0
 /// <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>());
 }
예제 #21
0
 /// <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>());
 }
예제 #22
0
 /// <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>());
 }
예제 #23
0
 /// <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>());
 }
예제 #24
0
 /// <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>());
 }
예제 #25
0
 /// <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>());
 }
예제 #26
0
 /// <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>());
 }