public void LoadFromXml(XmlElement xml) { this.LoadPropertiesCore(xml); IStoredConnection sconn = (IStoredConnection)StoredConnectionAddonType.Instance.LoadAddon(xml.FindElement("Connection")); m_conn = sconn.CreatePhysicalConnection(); }
public static ITreeNode FromStoredConnection(ITreeNode parent, IStoredConnection stored, IFileHandler fhandler) { IPhysicalConnection phys = stored.CreatePhysicalConnection(); if (stored.DatabaseMode == ConnectionDatabaseMode.All) { IServerSource conn = new GenericServerSource(phys); return(new Server_SourceConnectionTreeNode(conn, parent, fhandler, stored)); } else { string exdbname = stored.DatabaseMode == ConnectionDatabaseMode.Explicit ? stored.ExplicitDatabaseName : null; IDatabaseSource conn = new GenericDatabaseSource(null, phys, exdbname); return(new Database_SourceConnectionTreeNode(conn, parent, fhandler, stored, false)); } }