Ejemplo n.º 1
0
        public void OnNewPart(object sender, EventArgs e)
        {
            WorkItem newPartWorkItem = _rootWorkItem.WorkItems.AddNew <WorkItem>();
            ControlledWorkItem <ModuleController> controlledWorkItem = newPartWorkItem.WorkItems.AddNew <ControlledWorkItem <ModuleController> >();

            controlledWorkItem.Controller.Run();
        }
Ejemplo n.º 2
0
        public override void Load()
        {
            base.Load();

            ShellAction refreshAction = new ShellAction(this._rootWorkItem);

            refreshAction.Caption      = StringResources.Dashboard_Refresh;
            refreshAction.IsEnabled    = true;
            refreshAction.IsAuthorized = true;
            refreshAction.Id           = "action://Imi.SupplyChain.UX.Shell/DashboardRefresh";

            ActionCatalogService.RegisterActionImplementation(refreshAction.Id, OnDashboardRefresh);

            ShellInteractionService.Actions.Add(refreshAction);

            ShellAction arrangeAction = new ShellAction(this._rootWorkItem);

            arrangeAction.Caption      = StringResources.Dashboard_Arrange;
            arrangeAction.IsEnabled    = true;
            arrangeAction.IsAuthorized = true;
            arrangeAction.Id           = "action://Imi.SupplyChain.UX.Shell/DashboardArrange";

            ActionCatalogService.RegisterActionImplementation(arrangeAction.Id, OnDashboardArrange);

            ShellInteractionService.Actions.Add(arrangeAction);

            ControlledWorkItem <ShellController> shellWorkItem = _rootWorkItem.WorkItems.FindByType <ControlledWorkItem <ShellController> >().Last();

            _dashboardView = shellWorkItem.SmartParts.FindByType <IDashboardView>().Last();
        }
 private void OnCustomerWorkItemCreated(ControlledWorkItem <CustomerWorkItemController> entryWorkItem)
 {
     if (CustomerWorkItemCreated != null)
     {
         CustomerWorkItemCreated(this, new EventArgs <WorkItem>(entryWorkItem));
     }
 }
Ejemplo n.º 4
0
        public override void Load()
        {
            // Put the following code before InitializeComponent()
            // Sets the current culture
            Thread.CurrentThread.CurrentCulture = new CultureInfo(CultureInfo.CurrentCulture.Name);
            // Sets the current culture
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(CultureInfo.CurrentCulture.Name);



            base.Load();

            // Add layout view to the shell
            ShellLayoutView _shellLayout = _rootWorkItem.Items.AddNew <ShellLayoutView>();

            _rootWorkItem.Workspaces[WorkspaceNames.LayoutWorkspace].Show(_shellLayout);

            // Add window workspace to be used for modal windows
            WindowWorkspace wsp = new WindowWorkspace(_shellLayout.ParentForm);

            _rootWorkItem.Workspaces.Add(wsp, WorkspaceNames.ModalWindows);

            // Add window workspace to be used for screen saver
            WindowWorkspace scrSaver = new WindowWorkspace(_shellLayout.ParentForm);

            _rootWorkItem.Workspaces.Add(scrSaver, WorkspaceNames.ScreenSaverWindow);

            ControlledWorkItem <ModuleController> workItem = _rootWorkItem.WorkItems.AddNew <ControlledWorkItem <ModuleController> >();

            workItem.Controller.Run();
        }
        public void OnFindCustomer(object sender, EventArgs args)
        {
            ControlledWorkItem <FindCustomerController> findCustomerWorkItem =
                WorkItem.WorkItems.AddNew <ControlledWorkItem <FindCustomerController> >();

            findCustomerWorkItem.Controller.Run();
        }
Ejemplo n.º 6
0
        public override void Load()
        {
            base.Load();

            ControlledWorkItem <CommonController> commonWorkItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <CommonController> >("Uniframework.CommController");

            commonWorkItem.Run();
        }
Ejemplo n.º 7
0
        public override void Load()
        {
            base.Load();

            ControlledWorkItem <DemoCenterController> demoCenter = WorkItem.WorkItems.AddNew <ControlledWorkItem <DemoCenterController> >();

            demoCenter.Run();
        }
Ejemplo n.º 8
0
        public override void Load()
        {
            base.Load();

            ControlledWorkItem <UpgradeController> upgradeWorkItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <UpgradeController> >("UpgradeWorkItem");

            upgradeWorkItem.Run();
        }
Ejemplo n.º 9
0
        public override void Load()
        {
            base.Load();

            ControlledWorkItem <ModuleController> workItem = _rootWorkItem.WorkItems.AddNew <ControlledWorkItem <ModuleController> >();

            workItem.Controller.Run();
        }
Ejemplo n.º 10
0
        public override void Load()
        {
            base.Load();

            ControlledWorkItem <SwitchController> switchWorkItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <SwitchController> >();

            switchWorkItem.Run();
            //SwitchWorkItem switchWorkItem = workItem.WorkItems.AddNew<SwitchWorkItem>();
            //switchWorkItem.Init();
        }
Ejemplo n.º 11
0
        public override void Run()
        {
            log.Debug("PartModelingManager.ModuleController.Run");

            AddServices();
            ExtendMenu();
            ExtendToolStrip();
            AddViews();
            PrepareOcaf();

            // Create child WorkItems at the current WorkItem for the Sketcher and the PartModeling
            _modulePartModelingWorkItem = WorkItem.WorkItems.AddNew <WorkItem>(ControllerNames.PartModellingController);
            _moduleSketcherWorkItem     = WorkItem.WorkItems.AddNew <WorkItem>(ControllerNames.SketcherController);

            // Create a Layout on the MdiManager from the RootWorkItem, both child WorkItems will use it for display
            ResourceManager     resources     = new ResourceManager(typeof(ModelingManagerResources));
            WindowSmartPartInfo smartPartInfo = new WindowSmartPartInfo();

            smartPartInfo.Title = "New part";
            smartPartInfo.Icon  = (System.Drawing.Icon)resources.GetObject("NaroIcon");

            DeckWorkspace deckWorkspace = new DeckWorkspace();

            WorkItem.Items.Add(deckWorkspace);
            //deckWorkspace.Name = WorkspaceNames.DrawingAreaWorkspace;
            WorkItem.RootWorkItem.Workspaces[WorkspaceNames.LayoutWorkspace].Show(deckWorkspace, smartPartInfo);

            WorkItem.RootWorkItem.Workspaces[WorkspaceNames.LayoutWorkspace].SmartPartActivated += new EventHandler <WorkspaceEventArgs>(ModuleController_SmartPartActivated);
            WorkItem.RootWorkItem.Workspaces[WorkspaceNames.LayoutWorkspace].SmartPartClosing   += new EventHandler <WorkspaceCancelEventArgs>(ModuleController_SmartPartClosing);

            // Register on the current WorkItem the TreeViewWorkspace and DrawingAreaWorkspace to point to this layout
            _modulePartModelingWorkItem.Workspaces.Add(deckWorkspace, WorkspaceNames.DrawingAreaWorkspace);
            //_modulePartModelingWorkItem.Workspaces.Add(WorkItem.Workspaces[WorkspaceNames.TreeViewWorkspace], WorkspaceNames.TreeViewWorkspace);
            _moduleSketcherWorkItem.Workspaces.Add(deckWorkspace, WorkspaceNames.DrawingAreaWorkspace);
            //_moduleSketcherWorkItem.Workspaces.Add(WorkItem.Workspaces[WorkspaceNames.TreeViewWorkspace], WorkspaceNames.TreeViewWorkspace);

            // Start the two child WorkItems
            _partModelingWorkItem = _modulePartModelingWorkItem.WorkItems.AddNew <ControlledWorkItem <Naro.PartModeling.ModuleController> >("PartModelingController");
            log.Debug("Part modeling Run");
            _partModelingWorkItem.Controller.Run();
            log.Debug("Sketcher Run");
            _sketcherWorkItem = _moduleSketcherWorkItem.WorkItems.AddNew <ControlledWorkItem <Naro.Sketcher.ModuleController> >("SketcherController");
            _sketcherWorkItem.Controller.Run();

            // Start the flow by activating the 3D modeling WorkItem
            _currentWorkItem = _partModelingWorkItem;
            log.Debug("Part modeling ResumeRunning");
            _partModelingWorkItem.Controller.ResumeRunning();

            // Show the StartSketcher Toolstrip
            //IShellExtensionService extensionService = this.WorkItem.Services.Get<IShellExtensionService>();
            //extensionService.BeginUpdateLayout();
            //extensionService.ShowToolstrip(this.WorkItem, Constants.UIExtensionSiteNames.StartSketcher);
            //extensionService.EndUpdateLayout();
        }
Ejemplo n.º 12
0
        protected override void AddServices()
        {
            base.AddServices();

            ControlledWorkItem <DynamicHelpController> dynamicWorkItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <DynamicHelpController> >();

            dynamicWorkItem.Run();

            ControlledWorkItem <DataListController> datalistWorkItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <DataListController> >();

            datalistWorkItem.Run();
        }
        public override void OnShowAssemblyMonitorOverview(object sender, EventArgs e)
        {
            AssemblyMonitorOverviewViewParameters viewParameters = null;
            bool   openInNewWindow = false;
            string favoriteId      = string.Empty;

            if (e is MenuEventArgs)
            {
                openInNewWindow = ((MenuEventArgs)e).OpenInNewWindow;
                string parameters = ((MenuEventArgs)e).Parameters;
                favoriteId = ((MenuEventArgs)e).MenuItemId;

                if (!string.IsNullOrEmpty(parameters))
                {
                    viewParameters = new AssemblyMonitorOverviewViewParameters();
                    HyperlinkHelper.MapQueryString(parameters, viewParameters);
                }
            }
            else if (e is MenuItemExecutedEventArgs)
            {
                openInNewWindow = ((MenuItemExecutedEventArgs)e).OpenInNewWindow;
                string parameters = ((MenuItemExecutedEventArgs)e).MenuItem.Parameters;
                favoriteId = ((MenuItemExecutedEventArgs)e).MenuItem.Id;

                if (!string.IsNullOrEmpty(parameters))
                {
                    viewParameters = new AssemblyMonitorOverviewViewParameters();
                    HyperlinkHelper.MapQueryString(parameters, viewParameters);
                }
            }
            else if (e is DataEventArgs <AssemblyMonitorOverviewViewParameters> )
            {
                viewParameters = ((DataEventArgs <AssemblyMonitorOverviewViewParameters>)e).Data;
            }

            ControlledWorkItem <AssemblyMonitorController> workItem = (from wi in WorkItem.WorkItems.FindByType <ControlledWorkItem <AssemblyMonitorController> >()
                                                                       where wi.Items.Get <string>("ModuleId") == ShellInteractionService.ActiveModule.Id
                                                                       select wi).LastOrDefault();

            if (workItem == null || openInNewWindow)
            {
                workItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <AssemblyMonitorController> >();
                workItem.Items.Add(ShellInteractionService.ActiveModule.Id, "ModuleId");
                workItem.Controller.Run(viewParameters, favoriteId);
            }
            else
            {
                workItem.Controller.Activate(viewParameters, favoriteId);
            }
        }
Ejemplo n.º 14
0
        protected override void AddServices()
        {
            base.AddServices();

            // 成员管理
            ControlledWorkItem <MembershipController> membershipWorkItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <MembershipController> >("MembershipController");

            membershipWorkItem.Run();

            // 权限管理
            ControlledWorkItem <AuthorizationController> authWorkItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <AuthorizationController> >("AuthorizationController");

            authWorkItem.Run();
        }
Ejemplo n.º 15
0
        protected override void AfterShellCreated()
        {
            base.AfterShellCreated();

            _settingsLoadedEvent.WaitOne();

            Window mainWindow = Application.Current.MainWindow;

            mainWindow.Language = XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.IetfLanguageTag);
            mainWindow.Loaded  += MainWindowLoaded;

            ControlledWorkItem <ShellController> workItem = RootWorkItem.WorkItems.AddNew <ControlledWorkItem <ShellController> >();

            workItem.Controller.Run();
        }
        public override void Run()
        {
            log.Debug("Sketcher.ModuleController.ModuleLostFocus");
            AddServices();
            ExtendMenu();
            ExtendToolStrip();
            AddViews();

            // Display the toolstrips
            DisplaySketcherActionsToolstrip();
            DisplaySketcherDrawingToolstrip();

            // Start the use case
            _controlledWorkItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <SketcherViewWorkItemController> >();
            _controlledWorkItem.Controller.Run();
        }
        private WorkItem GetOrCreateEntryWorkItem(QueueEntry entry)
        {
            string workItemId = entry.QueueEntryID;
            ControlledWorkItem <CustomerWorkItemController> entryWorkItem = null;

            if (WorkItem.WorkItems.Contains(workItemId))
            {
                entryWorkItem = WorkItem.WorkItems.Get <ControlledWorkItem <CustomerWorkItemController> >(workItemId);
            }
            else
            {
                entryWorkItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <CustomerWorkItemController> >(workItemId);
                entryWorkItem.Controller.Run(entry, BranchSystemsWorkspace);
                OnCustomerWorkItemCreated(entryWorkItem);
            }
            return(entryWorkItem);
        }
        public ShellInteractionService([ServiceDependency] WorkItem workItem, IShellModule module, [ServiceDependency] IShellModuleService shellModuleService)
        {
            _workItem           = workItem;
            _module             = module;
            _shellModuleService = shellModuleService;

            _actions = new ObservableCollection <ShellAction>();
            _actions.CollectionChanged += ActionsCollectionChangedEventHandler;
            _actionDictionary           = new Dictionary <ShellAction, ShellDrillDownMenuItem>();
            _actionOrderList            = new List <ShellAction>();

            ControlledWorkItem <ShellController> shellWorkItem = workItem.RootWorkItem.WorkItems.FindByType <ControlledWorkItem <ShellController> >().Last();

            shellModuleService.RegisterModule(module, workItem);
            _model = shellModuleService.GetPresentationModel(module);

            _shellView = shellWorkItem.SmartParts.FindByType <IShellView>().Last();
        }
Ejemplo n.º 19
0
        public override void Load()
        {
            base.Load();

            // Add layout view to the shell
            ShellLayoutView _shellLayout = _rootWorkItem.Items.AddNew <ShellLayoutView>();

            _rootWorkItem.Workspaces[WorkspaceNames.LayoutWorkspace].Show(_shellLayout);

            // Add window workspace to be used for modal windows
            WindowWorkspace wsp = new WindowWorkspace(_shellLayout.ParentForm);

            _rootWorkItem.Workspaces.Add(wsp, WorkspaceNames.ModalWindows);

            // Add window workspace to be used for screen saver
            WindowWorkspace scrSaver = new WindowWorkspace(_shellLayout.ParentForm);

            _rootWorkItem.Workspaces.Add(scrSaver, WorkspaceNames.ScreenSaverWindow);

            ControlledWorkItem <ModuleController> workItem = _rootWorkItem.WorkItems.AddNew <ControlledWorkItem <ModuleController> >();

            workItem.Controller.Run();
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Adds the custom work item.
        /// </summary>
        private void AddCustomWorkItem()
        {
            ControlledWorkItem <TaskbarController> taskbarWorkItem = RootWorkItem.WorkItems.AddNew <ControlledWorkItem <TaskbarController> >();

            taskbarWorkItem.Run();
        }