當前位置: 首頁>>代碼示例>>C#>>正文


C# Factory.GetFields方法代碼示例

本文整理匯總了C#中System.Factory.GetFields方法的典型用法代碼示例。如果您正苦於以下問題:C# Factory.GetFields方法的具體用法?C# Factory.GetFields怎麽用?C# Factory.GetFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Factory的用法示例。


在下文中一共展示了Factory.GetFields方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Double_field_path

        public void Double_field_path()
        {
            var config = new Chinook();
            var factory = new Factory();
            var adapter = new FieldPathComboAdapter(factory);

            var path = new FieldPath(config["Track"]["AlbumId"], config["Album"]["Title"]);
            var fields1 = factory.GetFields(path[0].Subject);
            var fields2 = factory.GetFields(path[1].Subject);

            adapter.SelectedPath = path;
            Assert.AreEqual(2, adapter.Items.Count);
            Assert.AreEqual(fields1.Count, adapter.Items[0].Fields.Count);
            Assert.AreEqual(fields2.Count, adapter.Items[1].Fields.Count);
            Assert.Contains(path[0], adapter.Items[0].Fields);
            Assert.Contains(path[1], adapter.Items[1].Fields);
        }
開發者ID:AdamCollings,項目名稱:dbqf,代碼行數:17,代碼來源:FieldPathComboAdapter_Fixture.cs

示例2: Incomplete_field_path

        public void Incomplete_field_path()
        {
            var config = new Chinook();
            var factory = new Factory();
            var adapter = new FieldPathComboAdapter(factory);

            var path = new FieldPath(config["Track"]["AlbumId"], config["Album"]["ArtistId"]);
            var fields1 = factory.GetFields(path[0].Subject);
            var fields2 = factory.GetFields(path[1].Subject);
            var fields3 = factory.GetFields(config["Artist"]); // this should be added by SelectedPath

            adapter.SelectedPath = path;
            Assert.AreEqual(3, adapter.Items.Count);
            Assert.AreEqual(fields1.Count, adapter.Items[0].Fields.Count);
            Assert.AreEqual(fields2.Count, adapter.Items[1].Fields.Count);
            Assert.AreEqual(fields3.Count, adapter.Items[2].Fields.Count);
            Assert.Contains(path[0], adapter.Items[0].Fields);
            Assert.Contains(path[1], adapter.Items[1].Fields);
            Assert.Contains(path[2], adapter.Items[2].Fields);
        }
開發者ID:AdamCollings,項目名稱:dbqf,代碼行數:20,代碼來源:FieldPathComboAdapter_Fixture.cs

示例3: Single_field_path

        public void Single_field_path()
        {
            var config = new Chinook();
            var factory = new Factory();
            var adapter = new FieldPathComboAdapter(factory);

            var path = new FieldPath(config["Track"]["Name"]);
            var fields = factory.GetFields(path[0].Subject);

            adapter.SelectedPath = path;
            Assert.AreEqual(1, adapter.Items.Count);
            Assert.AreEqual(fields.Count, adapter.Items[0].Fields.Count);
            Assert.Contains(path[0], adapter.Items[0].Fields);
        }
開發者ID:AdamCollings,項目名稱:dbqf,代碼行數:14,代碼來源:FieldPathComboAdapter_Fixture.cs


注:本文中的System.Factory.GetFields方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。