public void ShowContacts()
        {
            // 5. Start the Contacts app
            var detailsApp = App.Glue.AppManager.Applications.FirstOrDefault((app) => app.Name == "Contacts");
            var context    = AppManagerContext.CreateNew();

            detailsApp?.Start(context).Wait();
        }
        private void StartAppWithURL(string url)
        {
            var webAppHostApp = this.GetWebManagerHost();

            var webAppHostContext = AppManagerContext.CreateNew();

            webAppHostContext.Set("url", url);
            webAppHostApp.Start(webAppHostContext);
        }
Example #3
0
        protected bool AuthorizeCore(HttpContextBase httpContext)
        {
            // Get the headers
            var headers = httpContext.Request.Headers;

            var appContext         = new AppManagerContext();
            var roleManagerContext = new RoleManagerContext();

            var permission = roleManagerContext.Permissions.First(perm => perm.Name == _apiKey);

            var user = appContext.Apps.FirstOrDefault(a => a.Id == _apiKey);

            //ADD LOGIC TO CONNECT USER TO ROLE!!!
            var role = new Role();

            if (role.Permissions.Contains(permission))
            {
                return(true);
            }

            return(false);
        }
        private void startButton_Click(object sender, RoutedEventArgs e)
        {
            var selectedApplication = applicationList.SelectedItem as IAppManagerApplication;

            if (selectedApplication != null)
            {
                var context = AppManagerContext.CreateNew();
                context.Set("startedFrom", Process.GetCurrentProcess().Id);
                var task = selectedApplication.Start(context);
                task.ContinueWith(t =>
                {
                    if (t.Status != TaskStatus.RanToCompletion)
                    {
                        // Applcation failed to start
                    }
                    else
                    {
                        // Started application instance
                        var instance = t.Result;
                    }
                });
            }
        }
Example #5
0
 public UtilProvider(AppManagerContext appManagerContext, RoleManagerContext roleManagerContext)
 {
     _appContext         = appManagerContext;
     _roleManagerContext = roleManagerContext;
 }