本文整理汇总了C#中Interfaces.GetNewInstance方法的典型用法代码示例。如果您正苦于以下问题:C# Interfaces.GetNewInstance方法的具体用法?C# Interfaces.GetNewInstance怎么用?C# Interfaces.GetNewInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interfaces
的用法示例。
在下文中一共展示了Interfaces.GetNewInstance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: allStorageableItems
private IEnumerable<Interfaces.IXMLStorageable> allStorageableItems(Interfaces.IXMLStorageable referenceStorageable)
{
var sw = new Performance.Stopwatch("allStorageableItems: " + referenceStorageable.XElementName);
sw.Start();
var list = new ObservableCollection<Interfaces.IXMLStorageable>();
var isregistered = from registered in RegisteredAdditionalDBs where registered.XElementName == referenceStorageable.XElementName select registered;
if (isregistered.Count() == 0)
return list;
XElement db = (from dbs in OtherDBs where dbs.Name == (referenceStorageable.XElementName + "s") select dbs).First();
if (!db.AncestorsAndSelf(referenceStorageable.XElementName + "s").Any())
return list;
var itemlist = db.AncestorsAndSelf(referenceStorageable.XElementName + "s").Elements(referenceStorageable.XElementName);
foreach (XElement item in itemlist)
{
try
{
var tempitem = referenceStorageable.GetNewInstance();
tempitem.ParseFromXElement(item);
list.Add(tempitem);
}
catch (Exception e) { logger.Fatal("Error parsing the element", e); }
}
sw.Stop();
logger.Info(sw.Result(list.Count()));
return list;
}