本文整理汇总了C#中Parse.Schedule方法的典型用法代码示例。如果您正苦于以下问题:C# Parse.Schedule方法的具体用法?C# Parse.Schedule怎么用?C# Parse.Schedule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse
的用法示例。
在下文中一共展示了Parse.Schedule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Excel2Lib
public static Library Excel2Lib(string file)
{
Library lib = LibraryDefaults.getHardCodedDefaultLib();
XSSFWorkbook wb;
// get sheets list from xlsx
using (var fs = new FileStream(file, FileMode.Open, FileAccess.Read))
{
wb = new XSSFWorkbook(fs);
}
Parse Wr = new Parse(wb, ref lib);
//Logger.WriteLine("Worksheets in file:");
for (int k = 0; k < wb.Count; k++)
{
// Debug.WriteLine("Worksheet " + wb.GetSheetAt(k).SheetName);
// Logger.WriteLine("Worksheet " + wb.GetSheetAt(k).SheetName);
}
//primitives
foreach (var o in Wr.Objects<OpaqueMaterial>("Material")) lib.Add(o);
foreach (var o in Wr.Constructions( "Construction")) lib.Add(o);
foreach (var o in Wr.Objects<GlazingConstructionSimple>("GlazingConstructionSimple")) lib.Add(o);
foreach (var o in Wr.Schedule("Schedule")) lib.Add(o);
foreach (var o in Wr.ArraySchedule("ArraySchedule")) lib.Add(o);
//zone defs
foreach (var o in Wr.Objects<ZoneLoad>("ZoneLoad")) lib.Add(o);
foreach (var o in Wr.Objects<ZoneConditioning>("ZoneConditioning")) lib.Add(o);
foreach (var o in Wr.Objects<ZoneVentilation>( "ZoneVentilation")) lib.Add(o);
foreach (var o in Wr.Objects<ZoneConstruction>("ZoneConstruction")) lib.Add(o);
foreach (var o in Wr.Objects<DomHotWater>("DomHotWater")) lib.Add(o);
//zone and window
foreach (var o in Wr.Objects<WindowSettings>("Window")) lib.Add(o);
foreach (var o in Wr.Zone("Zone")) lib.Add(o);
//building
foreach (var o in Wr.Objects<FloorDefinition>("Building")) lib.Add(o);
// generate building templates from floors
var list = new HashSet<string>(lib.FloorDefinitions.Select(x => x.BuildingID).ToList()).ToList();
foreach (var n in list) {
BuildingDefinition bd = new BuildingDefinition { Name = n };
bd.Floors.AddRange( lib.FloorDefinitions.Where(x => x.BuildingID == n) );
lib.Add(bd);
}
return lib;
}