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


C# PropertyCollection.GetProperty方法代码示例

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


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

示例1: TestAdd

 static void TestAdd(ref PropertyCollection collection, int count)
 {
     for (int i = 0; i < count; i++)
     {
         collection.SetProperty(i, i);
         Assert.AreEqual(collection.GetProperty(i), i);
     }            
 }
开发者ID:dw4dev,项目名称:Phalanger,代码行数:8,代码来源:PropertyCollectionTests.cs

示例2: TestRemove

 static void TestRemove(ref PropertyCollection collection, int count)
 {
     for (int i = 0; i < count; i++)
     {
         collection.RemoveProperty(i);
         Assert.AreEqual(collection.GetProperty(i), null);
     }
 }
开发者ID:dw4dev,项目名称:Phalanger,代码行数:8,代码来源:PropertyCollectionTests.cs

示例3: PropertyCollectionTest

        public void PropertyCollectionTest()
        {
            var collection = new PropertyCollection();

            for (int pass = 1; pass < 100; pass++)
            {
                collection.ClearProperties();
                Assert.AreEqual(collection.Count, 0);

                int count = pass * 2;

                TestAdd(ref collection, count);
                Assert.AreEqual(collection.Count, count);

                TestRemove(ref collection, count);
                Assert.AreEqual(collection.Count, 0);

                TestAdd(ref collection, count);
                Assert.AreEqual(collection.Count, count);

                // delete every second property
                for (int i = 0; i < count; i+=2)
                {
                    collection.RemoveProperty(i);
                    Assert.AreEqual(collection.GetProperty(i), null);
                }
                Assert.AreEqual(collection.Count, count / 2);

                // test property replacement
                for (int i = 1; i < count; i += 2)
                {
                    collection.SetProperty(i, i * 2);
                    Assert.AreEqual(collection.GetProperty(i), i * 2);
                }
                Assert.AreEqual(collection.Count, count / 2); 
            }
        }
开发者ID:dw4dev,项目名称:Phalanger,代码行数:37,代码来源:PropertyCollectionTests.cs

示例4: TestViewCreatedSetsNextHandlerOfTemplateCompletionHandler

        public static void TestViewCreatedSetsNextHandlerOfTemplateCompletionHandler()
        {
            var viewProperties = new PropertyCollection();

            var view = Substitute.For<IWpfTextView>();
            view.Properties.Returns(viewProperties);

            var viewAdapter = Substitute.For<IVsTextView>();

            var adapterFactory = Substitute.For<IVsEditorAdaptersFactoryService>();
            adapterFactory.GetWpfTextView(viewAdapter).Returns(view);

            ITemplateEditorOptions options = OptionsWithCompletionListsEnabled(true);

            var provider = new TemplateCompletionHandlerProvider(options, adapterFactory, Substitute.For<SVsServiceProvider>(), Substitute.For<ICompletionBroker>());
            provider.VsTextViewCreated(viewAdapter);

            var handler = (TemplateCompletionHandler)viewProperties.GetProperty(typeof(TemplateCompletionHandler));
            viewAdapter.Received().AddCommandFilter(handler, out handler.NextHandler);
        }
开发者ID:icool123,项目名称:T4Toolbox,代码行数:20,代码来源:TemplateCompletionHandlerProviderTest.cs


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