Example #1
0
        private string OpenApp(string appKey)
        {
            ApplicationInfo app;

            if (this.AppMan.Apps.TryGetValue(appKey, out app))
            {
                object instance;
                if (!this.AppInstances.TryGetValue(app, out instance))
                {
                    instance = app.Asm.CreateInstance(app.AppType.ToString());
                    ApplicationBase appbase = (ApplicationBase)instance;
                    appbase.User = this.UserWrapper;
                    appbase.AppLoad();

                    this.AppInstances.Add(app, instance);
                }

                this.CurrentApp    = new KeyValuePair <ApplicationInfo, object>(app, instance);
                this.CurrentAppKey = appKey;

                return(string.Format("{0} has been loaded.", appKey));
            }

            return(string.Format("Unable to find appliation \"{0}\"", appKey));
        }