本文整理汇总了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);
}
示例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);
}
示例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);
}