/// <summary> /// Loads building definition from given xml file. /// </summary> /// <param name="file">Path to building definition file.</param> public void LoadBuilding(string file) { CurrentFile = file; Common.DataModel.Building building = new Common.DataModel.Building(); building.Load(file); var viewMode = CurrentBuilding != null ? CurrentBuilding.ViewMode : ""; CurrentBuilding = new Building(building); CurrentBuilding.ViewMode = viewMode; _debugInfo.Building = CurrentBuilding; }
private void LoadBuilding() { LoadBuildingPath(); var buildingCommonModel = new Common.DataModel.Building(); buildingCommonModel.Load(buildingPath); building = new Building(buildingCommonModel); }
/// <summary> /// Loads building definition from given xml file. /// </summary> /// <param name="file">Path to building definition file.</param> public void LoadBuilding(string file) { CurrentFile = file; Common.DataModel.Building building = new Common.DataModel.Building(); building.Load(file); CurrentBuilding = new Building(building); }
/// <summary> /// Converts building view model to data model that can be stored in xml file. /// </summary> /// <see cref="Common.DataModel.Building"/> public Common.DataModel.Building ToDataModel() { Common.DataModel.Building result = new Common.DataModel.Building(); for (int i = 0; i < Floors.Count; i++) result.Floors.Add(Floors[i].ToDataModel()); for (int i = 0; i < Stairs.Count; i++) result.Stairs.Add(Stairs[i].ToDataModel()); return result; }