当前位置: 首页>>代码示例>>C#>>正文


C# DomNode.AsAll方法代码示例

本文整理汇总了C#中DomNode.AsAll方法的典型用法代码示例。如果您正苦于以下问题:C# DomNode.AsAll方法的具体用法?C# DomNode.AsAll怎么用?C# DomNode.AsAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DomNode的用法示例。


在下文中一共展示了DomNode.AsAll方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveNode

 /// <summary>
 /// Performs custom actions for a node that has been removed from the DOM subtree</summary>
 /// <param name="node">Removed node</param>
 protected override void RemoveNode(DomNode node)
 {
     // route all other histories back into a local history
     foreach (HistoryContext historyContext in node.AsAll<HistoryContext>())
         if (historyContext != m_historyContext)
         {
             m_childHistoryContexts.Remove(historyContext);
             historyContext.History = new CommandHistory();
         }
 }
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:13,代码来源:GlobalHistoryContext.cs

示例2: AddNode

 /// <summary>
 /// Performs custom actions for a node that has been added to the DOM subtree</summary>
 /// <param name="node">Added node</param>
 protected override void AddNode(DomNode node)
 {
     // route all other histories into the global one
     foreach (HistoryContext historyContext in node.AsAll<HistoryContext>())
         if (historyContext != m_historyContext)
         {
             m_childHistoryContexts.Add(historyContext);
             historyContext.History = m_historyContext.History;
         }
 }
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:13,代码来源:GlobalHistoryContext.cs

示例3: AddNode

        /// <summary>
        /// Performs custom actions for a node that has been added to the DOM node subtree</summary>
        /// <param name="node">Added node</param>
        protected override void AddNode(DomNode node)
        {
            foreach (HistoryContext historyContext in node.AsAll<HistoryContext>())
            {
                // Disable automatically combining attribute setting operations, as operations such as grouping pin index changes better run its course   
                historyContext.PendingSetOperationLifetime = TimeSpan.Zero;
                m_historyContexts.Add(historyContext);
            }

            base.AddNode(node);
        }
开发者ID:vincenthamm,项目名称:ATF,代码行数:14,代码来源:CircuitValidator.cs

示例4: AddNode

        /// <summary>
        /// Performs custom actions for a node that has been added to the DOM node subtree</summary>
        /// <param name="node">Added node</param>
        protected override void AddNode(DomNode node)
        {
            foreach (HistoryContext historyContext in node.AsAll<HistoryContext>())
            {
                //Alan: re-enabled historyContext's merge feature.
                //      It was disabled with the below with comment. 
                //      But from the commit comment it seems that the feature was
                //      disabled because of some functional test failure in a particular ATF base tool (creature editor).
                //      
                // Disable automatically combining attribute setting operations, as operations such as grouping pin index changes better run its course   
                //historyContext.PendingSetOperationLifetime = TimeSpan.Zero;
                m_historyContexts.Add(historyContext);
            }

            base.AddNode(node);
        }
开发者ID:jethac,项目名称:ATF,代码行数:19,代码来源:CircuitValidator.cs

示例5: RemoveNode

 /// <summary>
 /// Performs custom actions for a node that has been removed from the DOM node subtree</summary>
 /// <param name="node">Removed node</param>
 protected override void RemoveNode(DomNode node)
 {
     foreach (HistoryContext historyContext in node.AsAll<HistoryContext>())
         m_historyContexts.Remove(historyContext);
     base.RemoveNode(node);        
 }
开发者ID:vincenthamm,项目名称:ATF,代码行数:9,代码来源:CircuitValidator.cs

示例6: TestDuplicateExtensionInfo

        public void TestDuplicateExtensionInfo()
        {
            var ext1 = new ExtensionInfo<TestAdapter1>("foo");
            var ext2 = new ExtensionInfo<TestAdapter2>("foo");

            var domType = new DomNodeType(
                "test",
                null,
                EmptyEnumerable<AttributeInfo>.Instance,
                EmptyEnumerable<ChildInfo>.Instance,
                new ExtensionInfo[] { ext1, ext2 });

            var domNode = new DomNode(domType);

            object resultExt1 = domNode.GetExtension(ext1);
            object resultExt2 = domNode.GetExtension(ext2);

            Assert.IsTrue(resultExt1 is TestAdapter1);
            Assert.IsTrue(resultExt2 is TestAdapter2);

            object[] decorators = domNode.GetDecorators(typeof(object)).ToArray();
            Assert.IsTrue(
                decorators.Length == 2 &&
                decorators[0] == resultExt1 &&
                decorators[1] == resultExt2);

            DomNodeAdapter[] extensions = domNode.AsAll<DomNodeAdapter>().ToArray();
            Assert.IsTrue(
                extensions.Length == 2 &&
                extensions[0] == resultExt1 &&
                extensions[1] == resultExt2);

            // Searching by name is a problem, though. The search is ambiguous.
            // See tracker item for discussion: http://tracker.ship.scea.com/jira/browse/WWSATF-522
            Assert.Throws<InvalidOperationException>(() => domType.GetExtensionInfo("foo"));
        }
开发者ID:sbambach,项目名称:ATF,代码行数:36,代码来源:TestDomNodeType.cs

示例7: AddNode

 /// <summary>
 /// Performs custom actions for a node that has been added to the DOM subtree</summary>
 /// <param name="node">Added node</param>
 /// <remarks>Method overrides must call the base method.</remarks>
 protected override void AddNode(DomNode node)
 {
     foreach (IValidationContext validationContext in node.AsAll<IValidationContext>())
     {
         validationContext.Beginning += validationContext_Beginning;
         validationContext.Ending += validationContext_Ending;
         validationContext.Ended += validationContext_Ended;
         validationContext.Cancelled += validationContext_Cancelled;
     }
 }
开发者ID:JanDeHud,项目名称:LevelEditor,代码行数:14,代码来源:Validator.cs

示例8: RemoveNode

 /// <summary>
 /// Performs custom actions for a node that has been removed from the DOM subtree</summary>
 /// <param name="node">Removed node</param>
 protected override void RemoveNode(DomNode node)
 {
     foreach (IHistoryContext context in node.AsAll<IHistoryContext>())
         context.DirtyChanged -= History_DirtyChanged;
 }
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:8,代码来源:MultipleHistoryContext.cs


注:本文中的DomNode.AsAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。