RusticiSoftware / SCORMCloud_NetLibrary

A C# library to assist in the integration of the SCORM Cloud service into .Net 2.0+ applications.
http://scorm.com/scorm-solved/scorm-cloud/develop-a-scorm-cloud-app/
Other
11 stars 22 forks source link

Re-initializing the Scorm Config after the Secret Key and Application Id Change #22

Open musicm122 opened 8 years ago

musicm122 commented 8 years ago

Ello, I've been trying to figure out a way to re-init the Scorm Configuration when handling multiple App Ids and Secret Key Combinations.

I've tried doing this:

ScormCloud.Configuration = new Configuration(ScormServiceUrl, AppliationId, SecretKey, Origin);

in a call like this:

    public static void UpdateScormConfig(string origin = "", string appId = "", string secretKey = "")
        {
            origin = string.IsNullOrWhiteSpace(origin) ? Origin : origin;
            appId = string.IsNullOrWhiteSpace(appId) ? AppliationId : appId;
            secretKey = string.IsNullOrWhiteSpace(secretKey) ? SecretKey : secretKey;

            SetKeys(appId, secretKey);
            ScormCloud.Configuration = new Configuration(ScormServiceUrl, appId, secretKey, origin);
            IsInitialized = true;
        }

but the existing configuration persists when I access

ScormCloud.CourseService.GetCourseList();

as its ref'd config has already been set. in the various services such as 'CourseService' and cant be touched directly.

Is there a way around this currently that I'm not seeing?