本文整理匯總了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);
}