/// <summary> /// Adjusts for dynamic loading when no entry assembly is available/configurable. /// </summary> /// <remarks> /// When dynamic loading is used, the configuration path from the /// applications entry assembly to the connection setting might be broken. /// This method makes up the necessary configuration entries. /// </remarks> static public void AdjustForDynamicLoad() { if( thePerformanceTestContext == null ) thePerformanceTestContext = new PerformanceTestContext(); if( thePerformanceTestContext.myDatabase == null ) { string assumedInitialConfiguration = "<openaccess>" + "<references>" + "<reference assemblyname='PLACEHOLDER' configrequired='True'/>" + "</references>" + "</openaccess>"; System.Reflection.Assembly dll = thePerformanceTestContext.GetType().Assembly; assumedInitialConfiguration = assumedInitialConfiguration.Replace( "PLACEHOLDER", dll.GetName().Name); System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument(); xmlDoc.LoadXml(assumedInitialConfiguration); Database db = Telerik.OpenAccess.Database.Get("PerformanceTest", xmlDoc.DocumentElement, new System.Reflection.Assembly[] { dll } ); thePerformanceTestContext.myDatabase = db; } }
/// <summary> /// Adjusts for dynamic loading when no entry assembly is available/configurable. /// </summary> /// <remarks> /// When dynamic loading is used, the configuration path from the /// applications entry assembly to the connection setting might be broken. /// This method makes up the necessary configuration entries. /// </remarks> static public void AdjustForDynamicLoad() { if (thePerformanceTestContext == null) { thePerformanceTestContext = new PerformanceTestContext(); } if (thePerformanceTestContext.myDatabase == null) { string assumedInitialConfiguration = "<openaccess>" + "<references>" + "<reference assemblyname='PLACEHOLDER' configrequired='True'/>" + "</references>" + "</openaccess>"; System.Reflection.Assembly dll = thePerformanceTestContext.GetType().Assembly; assumedInitialConfiguration = assumedInitialConfiguration.Replace( "PLACEHOLDER", dll.GetName().Name); System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument(); xmlDoc.LoadXml(assumedInitialConfiguration); Database db = Telerik.OpenAccess.Database.Get("PerformanceTest", xmlDoc.DocumentElement, new System.Reflection.Assembly[] { dll }); thePerformanceTestContext.myDatabase = db; } }
/// <summary> /// Returns the instance of Database for the connectionId /// specified in the Enable Project Wizard. /// </summary> /// <returns>Instance of Database.</returns> /// <remarks></remarks> static public Database Database() { if (thePerformanceTestContext == null) { thePerformanceTestContext = new PerformanceTestContext(); } if (thePerformanceTestContext.myDatabase == null) { thePerformanceTestContext.myDatabase = Telerik.OpenAccess.Database.Get("PerformanceTest"); } return(thePerformanceTestContext.myDatabase); }
/// <summary> /// Returns the instance of Database for the connectionId /// specified in the Enable Project Wizard. /// </summary> /// <returns>Instance of Database.</returns> /// <remarks></remarks> static public Database Database() { if( thePerformanceTestContext == null ) thePerformanceTestContext = new PerformanceTestContext(); if( thePerformanceTestContext.myDatabase == null ) thePerformanceTestContext.myDatabase = Telerik.OpenAccess.Database.Get( "PerformanceTest" ); return thePerformanceTestContext.myDatabase; }