public CurrentComponents(double currentspeed, double currentdirection) { //_UComp = new List<double>(); //_VComp = new List<double>(); VBProjectManager _proj = VBProjectManager.GetProjectManager(); _beachOrientation = _proj.SiteInfo.Orientation; //use baseclass method to get components if (WindCmponents(currentspeed, currentdirection)) { _UComp.Add(_Ucomp); _VComp.Add(_Vcomp); } else { _UComp = null; _VComp = null; } }
//public ProjectData(XPathNavigator navigator) public ProjectData() { if (_projectfile != string.Empty) { _xmldoc = new XmlDocument(); try { _xmldoc.Load(_projectfile); } catch (XmlException) { throw new ApplicationException("Problem reading the project file, file name:" + _projectfile.ToString()); } catch (FileNotFoundException) { throw new ApplicationException("Can't find project file: " + _projectfile.ToString() + " -- probably need to delete recentProjects.xml in the \bin directory"); } catch (DirectoryNotFoundException) { throw new ApplicationException("Can't find project file: " + _projectfile.ToString() + " -- probably need to delete recentProjects.xml in the \bin directory"); } _nav = _xmldoc.CreateNavigator(); _projMgr = VBProjectManager.GetProjectManager(); } }
public void Open(string projectFile) { VBProjectManager vbproj = VBProjectManager.GetProjectManager(); XmlDeserializer deserializer = new XmlDeserializer(); _graph = deserializer.Deserialize(projectFile) as object[]; _projectType = (Globals.ProjectType)_graph[0]; _site = _graph[1] as Site; DataSet ds = null; //_dtImportedData = null; //if (_graph[1] != null) //{ // string xmlImportedData = _graph[1] as string; // if (!String.IsNullOrEmpty(xmlImportedData) || (xmlImportedData != "")) // { // _dtImportedData = new DataTable("ImportedData"); // ds = new DataSet(); // ds.ReadXml(new StringReader(xmlImportedData),XmlReadMode.ReadSchema); // _dtImportedData = ds.Tables[0]; // ds = null; // vbproj.ImportedData = _dtImportedData; // } //} _dtCorrelationData = null; if (_graph[2] != null) { string xmlCorrelationData = _graph[2] as string; if (!String.IsNullOrEmpty(xmlCorrelationData) || (xmlCorrelationData != "")) { _dtCorrelationData = new DataTable("CorrelationData"); ds = new DataSet(); ds.ReadXml(new StringReader(xmlCorrelationData), XmlReadMode.ReadSchema); _dtCorrelationData = ds.Tables[0]; vbproj.CorrelationDataTable = _dtCorrelationData; } } if (_graph[3].GetType() == typeof(MLRModelingInfo)) { _modelingInfo = _graph[3] as MLRModelingInfo; } else { _modelingInfo = null; } FileInfo fi = new FileInfo(projectFile); _projectName = fi.Name; ProjectOpened(this); }