Ejemplo n.º 1
0
 public void QueryContextMenu(ContextMenuUI ui, MouseEvent evt, params object[] objs)
 {
     var obj = objs.FirstOrDefault() as ChangeDatabaseCommand;
     if (obj != null)
     {
         var databaseService = InvertApplication.Container.Resolve<DatabaseService>();
         foreach (var item in databaseService.Configurations.Values)
         {
             var item1 = item;
             ui.AddCommand(new ContextMenuItem()
             {
                 Title = item.Title,
                 Group = "Databases",
                 Checked = databaseService.CurrentConfiguration == item,
                 Command = new LambdaCommand("Change Database", () =>
                 {
                     Signal<IChangeDatabase>(cd => cd.ChangeDatabase(item1));
                 })
             });
         }
      
         ui.AddCommand(new ContextMenuItem()
         {
             Title = "Manage",
             Group="Manage",
             Command = new LambdaCommand("Manage Databases", () => EnableWizard = true),
             
         });
     }
 }
        public void QueryContextMenu(ContextMenuUI ui, MouseEvent evt, params object[] obj)
        {
            if (WorkspaceService.Workspaces.Count() >= 8)
            {
                var selectProject = obj.FirstOrDefault() as SelectWorkspaceCommand;
                if (selectProject != null)
                {
                    foreach (var item in WorkspaceService.Workspaces)
                    {
                        ui.AddCommand(new ContextMenuItem()
                        {
                            Title = item.Name,
                            Group = "Workspaces",
                            Checked = item == WorkspaceService.CurrentWorkspace,
                            Command = new OpenWorkspaceCommand()
                            {
                                Workspace = item
                            }
                        });
                    }
                    //if (WorkspaceService.Configurations != null)
                    //{
                    //    ui.AddSeparator();
                    //    foreach (var item in WorkspaceService.Configurations)
                    //    {
                    //        var title = item.Value.Title ?? item.Key.Name;
                    //        ui.AddCommand(new ContextMenuItem()
                    //        {
                    //            Title = string.Format("Create New {0} Workspace", title),
                    //            Command = new CreateWorkspaceCommand()
                    //            {
                    //                Name = string.Format("New {0} Workspace", title),
                    //                Title = string.Format("New {0} Workspace", title),
                    //                WorkspaceType = item.Key,
                    //            }
                    //        });
                    //    }
                    //}
         
                    ui.AddCommand(new ContextMenuItem()
                    {
                        Command = new LambdaCommand("Manage Workspaces", () => EnableWizard = true),
                        Group = "Manage",
                        Title = "Manage"
                    });



                }
            }
           
        }
 public void QueryContextMenu(ContextMenuUI ui, MouseEvent evt, params object[] obj)
 {
   //  throw new NotImplementedException();
 }