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); }
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); }