예제 #1
0
 public void RemoveAppInstance(string instanceName)
 {
     try
     {
         if (AppInstances.ContainsKey(instanceName))
         {
             AppInstances.Remove(instanceName);
         }
         else
         {
             throw new Exception("App Instance '" + instanceName + "' not found!");
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
        public void AddAppInstance(string instanceName, object appObject)
        {
            if (AppInstances.ContainsKey(instanceName) && engineSettings.OverrideExistingAppInstances)
            {
                ReportProgress("Overriding Existing Instance: " + instanceName);
                AppInstances.Remove(instanceName);
            }
            else if (AppInstances.ContainsKey(instanceName) && !engineSettings.OverrideExistingAppInstances)
            {
                throw new Exception("App Instance already exists and override has been disabled in engine settings! Enable override existing app instances or use unique instance names!");
            }

            try
            {
                this.AppInstances.Add(instanceName, appObject);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }