public MainFormInteractor(IServiceProvider services)
 {
     this.dlgFactory = services.RequireService<IDialogFactory>();
     this.mru = new MruList(MaxMruItems);
     this.mru.Load(MruListFile);
     this.sc = services.RequireService<IServiceContainer>();
     this.nextPage = new Dictionary<IPhasePageInteractor, IPhasePageInteractor>();
 }
Exemple #2
0
        public ShellViewModel(IWindowManager windowManager, IDialogFactory dialogFactory)
        {
            this.DisplayName = "Hello Dialog";

            this.windowManager = windowManager;
            this.dialogFactory = dialogFactory;

            this.NameString = "Click the button to show the dialog";
        }
        public TextBoxHelper(bool optionalPathButton, bool isPath = false, IDialogFactory factory = null)
        {
            if(optionalPathButton && factory == null)
                throw new ArgumentNullException(nameof(factory));

            _optionalPathButton = optionalPathButton;
            _isPath = isPath;
            _factory = factory;
        }
		public AGSGameFactory(IGraphicsFactory graphics, IInventoryFactory inventory, IUIFactory ui,
			IRoomFactory room, IOutfitFactory outfit, IObjectFactory obj, IDialogFactory dialog, IAudioFactory sound)
		{
			Graphics = graphics;
			Inventory = inventory;
			UI = ui;
			Room = room;
			Outfit = outfit;
			Object = obj;
			Dialog = dialog;
			Sound = sound;
		}
        public void Setup()
        {
            repository = new MockRepository();
            interactor = repository.Stub<DisassemblyViewInteractor>();
            sc = new ServiceContainer();
            uiSvc = repository.DynamicMock<IDecompilerShellUiService>();
            dcSvc = repository.Stub<IDecompilerService>();
            dlgFactory = repository.DynamicMock<IDialogFactory>();
            sc.AddService<IDecompilerShellUiService>(uiSvc);

            sc.AddService<IDecompilerService>(dcSvc);
            sc.AddService<IDialogFactory>(dlgFactory);
        }
 public InventoryCountController(InventoryCountModel model,
                                 ISheet sheet,
                                 IDialogFactory dialogFactory,
                                 IUpdateQuantity updateQuantity,
                                 IFetchItems fetchItems)
     : base(model, sheet)
 {
     _model = model;
     _dialogFactory = dialogFactory;
     _updateQuantity = updateQuantity;
     _fetchItems = fetchItems;
     model.CountRequest = CountHandler;
 }
 public ReturnItemController(ReturnItemModel model,
                             IFetchItems fetchItems,
                             ISheet sheet,
                             IUpdateQuantity updateQuantity,
                             IDialogFactory dialogFactory)
     : base(model, sheet)
 {
     _model = model;
     _fetchItems = fetchItems;
     _updateQuantity = updateQuantity;
     _dialogFactory = dialogFactory;
     SetShifter();
 }
 public AdjustController(AdjustReorderModel model,
                         ISheet sheet,
                         IRepository<item> items,
                         IFetchItems fetchItems,
                         ISave save,
                         IDialogFactory dialogFactory)
     : base(model, sheet)
 {
     _model = model;
     _items = items;
     _fetchItems = fetchItems;
     _save = save;
     _dialogFactory = dialogFactory;
     _model.AdjustmentRequest = PrepareAdjustment;
 }
 public RestockController(RestockModel model,
                          ISheet sheet,
                          IFetchItems fetchItems,
                          IUpdateQuantity update,
                          IRepository<restockhistory> restock,
                          IDialogFactory dialogFactory)
     : base(model, sheet)
 {
     _model = model;
     _fetchItems = fetchItems;
     _update = update;
     _restock = restock;
     _dialogFactory = dialogFactory;
     _model.QuantityRequest = RequestForQuantity;
 }
 public UserConfigController(UserConfigModel model,
                             ISheet sheet,
                             IFetchUsers users,
                             IChangePassword password,
                             IDialogFactory dialogFactory)
     : base(model, sheet)
 {
     _model = model;
     _users = users;
     _password = password;
     _dialogFactory = dialogFactory;
     model.HandleTransactionReport = ReportHandler;
     model.HandlePasswordReset = ResetPasswordHandler;
     model.HandleChangeAccess = ChangeAccessHandler;
 }
        public void Setup()
        {
            mr = new MockRepository();
            sp = new ServiceContainer();
            uiSvc = mr.StrictMock<IDecompilerShellUiService>();
            uiPrefsSvc = mr.StrictMock<IUiPreferencesService>();
            dlgFactory = mr.StrictMock<IDialogFactory>();
            uiSvc.Stub(u => u.GetContextMenu(MenuIds.CtxMemoryControl)).Return(new ContextMenu());
            uiSvc.Stub(u => u.GetContextMenu(MenuIds.CtxDisassembler)).Return(new ContextMenu());
            uiSvc.Replay();
            uiPrefsSvc.Stub(u => u.Styles).Return(new Dictionary<string, UiStyle>());
            uiPrefsSvc.Replay();
            sp.AddService(typeof(IDecompilerShellUiService), uiSvc);
			sp.AddService(typeof(IDialogFactory), dlgFactory);
            sp.AddService(typeof(IUiPreferencesService), uiPrefsSvc);
            addrBase = Address.Ptr32(0x1000);
        }
Exemple #12
0
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(IProjectManager projectManager, IAuthenticationManager authManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, ICodeProviderFactory codeProviderFactory, IGlobalConfiguration userConfiguration, MessageManager messageManager)
 {
     Instance = new CreateMethodCmd(projectManager, authManager, dialogFactory, projectConfigurationManager, codeProviderFactory, userConfiguration, messageManager);
 }
 public GetPromoProductByCardTask(IDialogFactory dialogFactory)
 {
     _dialogFactory = dialogFactory;
 }
        public SelectPathViewModel(IDialogFactory dialogFactory,
                                   DirectoryItemType searchToLevel,
                                   IIOWrapper iOWrapper,
                                   MessageManager messageManager,
                                   string rootPath      = "",
                                   string startPath     = "",
                                   string fileExtantion = "")
        {
            if (dialogFactory == null)
            {
                throw new ArgumentNullException(nameof(dialogFactory));
            }
            if (iOWrapper == null)
            {
                throw new ArgumentNullException(nameof(iOWrapper));
            }
            if (messageManager == null)
            {
                throw new ArgumentNullException(nameof(messageManager));
            }

            this.dialogFactory  = dialogFactory;
            this.iOWrapper      = iOWrapper;
            this.messageManager = messageManager;

            this.searchToLevel       = searchToLevel;
            this.selectedPath        = startPath;
            this.newFolderCommand    = new RelayCommand <object>(OnNewFolderClick);
            this.renameFolderCommand = new RelayCommand <object>(OnRenameFolderClick);
            this.deleteFolderCommand = new RelayCommand <object>(OnDeleteFolderClick);
            this.okCommand           = new RelayCommand <object>(OkCommandClick);
            this.closeCommand        = new RelayCommand <object>(OnCloseCliked);
            this.pathChangeCommand   = new RelayCommand <object>(OnPathChange);

            this.SelectionChanged += OnFolderPathChange;
            this.DirectoryItems    = new ObservableCollection <DirectoryItemViewModel>();

            List <DirectoryItem> children;

            if (System.IO.Directory.Exists(rootPath))
            {
                children = new List <DirectoryItem> {
                    new DirectoryItem()
                    {
                        FullPath = rootPath, Type = DirectoryItemType.Folder
                    }
                };
            }
            else
            {
                children = DirectoryStructure.GetLogicalDrives();
            }

            foreach (DirectoryItem drive in children)
            {
                var childViewModel = new DirectoryItemViewModel(drive.FullPath, drive.Type, searchToLevel, fileExtantion);
                childViewModel.SelectDirectoryItem += OnSelectDirectoryItem;
                this.DirectoryItems.Add(childViewModel);
            }

            if (!string.IsNullOrEmpty(startPath) && (System.IO.Directory.Exists(startPath) || File.Exists(startPath)))
            {
                var pathList = startPath.Split(Path.DirectorySeparatorChar).ToList();
                Navigate(this.DirectoryItems, pathList);
            }
            //TODO: navigate to path
        }
Exemple #15
0
 public static void Initialize(IProjectManager projectManager, IAuthenticationManager authManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, ICodeProviderFactory codeProviderFactory, MessageManager messageManager)
 {
     Instance = new SaveToArasCmd(projectManager, authManager, dialogFactory, projectConfigurationManager, codeProviderFactory, messageManager);
 }
Exemple #16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateMethodCmd"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        private CreateMethodCmd(IProjectManager projectManager, IAuthenticationManager authManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, ICodeProviderFactory codeProviderFactory, IGlobalConfiguration userConfiguration, MessageManager messageManager) : base(authManager, dialogFactory, projectManager, projectConfigurationManager, codeProviderFactory, messageManager)
        {
            this.globalConfiguration = userConfiguration ?? throw new ArgumentNullException(nameof(userConfiguration));

            if (projectManager.CommandService != null)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                var menuItem      = new OleMenuCommand(this.ExecuteCommand, menuCommandID);
                menuItem.BeforeQueryStatus += CheckCommandAccessibility;

                projectManager.CommandService.AddCommand(menuItem);
            }
        }
Exemple #17
0
 public DialogService(IDialogFactory dialogFactory)
 {
     _dialogFactory = dialogFactory;
 }
 public AskIfWantProductPositionTask(IDialogFactory dialogFactory)
 {
     _dialogFactory = dialogFactory;
 }
 /// <summary>
 ///  Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="projectManager"></param>
 /// <param name="dialogFactory"></param>
 /// <param name="projectConfigurationManager"></param>
 public static void Initialize(IProjectManager projectManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, MessageManager messageManager)
 {
     Instance = new RefreshConfigCmd(projectManager, dialogFactory, projectConfigurationManager, messageManager);
 }
Exemple #20
0
        public AGSGameFactory(IGraphicsFactory graphics, IInventoryFactory inventory, IUIFactory ui,
                              IRoomFactory room, IOutfitFactory outfit, IObjectFactory obj, IDialogFactory dialog,
                              IAudioFactory sound, IFontFactory fontFactory, IResourceLoader resources, IShaderFactory shaders,
                              Resolver resolver)
        {
            Graphics  = graphics;
            Inventory = inventory;
            UI        = ui;
            Room      = room;
            Outfit    = outfit;
            Object    = obj;
            Dialog    = dialog;
            Sound     = sound;
            Fonts     = fontFactory;
            Resources = resources;
            TypedParameter gameFactoryParam = new TypedParameter(typeof(IGameFactory), this);

            Masks   = resolver.Container.Resolve <IMaskLoader>(gameFactoryParam);
            Shaders = shaders;
        }
 public MessagesController(IConversationWrapper conversationWrapper,
                           IDialogFactory dialogFactory)
 {
     this.conversationWrapper = conversationWrapper;
     this.dialogFactory       = dialogFactory;
 }
Exemple #22
0
 public HelpScorable(IDialogTask task, IDialogFactory dialogFactory)
 {
     SetField.NotNull(out this.task, nameof(task), task);
     SetField.NotNull(out this.dialogFactory, nameof(dialogFactory), dialogFactory);
 }
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(IProjectManager projectManager, IAuthenticationManager authManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, MessageManager messageManager)
 {
     Instance = new ConnectionInfoCmd(projectManager, authManager, dialogFactory, projectConfigurationManager, messageManager);
 }
        private DebugMethodCmd(IProjectManager projectManager, IAuthenticationManager authManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, ICodeProviderFactory codeProviderFactory, MessageManager messageManager) : base(authManager, dialogFactory, projectManager, projectConfigurationManager, codeProviderFactory, messageManager)
        {
            if (projectManager.CommandService != null)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                var menuItem      = new OleMenuCommand(this.ExecuteCommand, menuCommandID);
                menuItem.BeforeQueryStatus += CheckCommandAccessibility;

                projectManager.CommandService.AddCommand(menuItem);
            }
        }
Exemple #25
0
 public MainDialog(IDialogFactory dialogFactory)
 {
     _dialogFactory = dialogFactory;
 }
Exemple #26
0
 public EntryDialog(IDialogFactory dialogFactory)
 {
     this.dialogFactory = dialogFactory;
 }
 public Form1(IDialogFactory dialogFactory)
 {
     _dialogFactory = dialogFactory;
     InitializeComponent();
 }
        private void Given_MainFormInteractor()
        {
            prog          = CreateFakeProgram();
            svcFactory    = mr.StrictMock <IServiceFactory>();
            archSvc       = mr.StrictMock <IArchiveBrowserService>();
            dlgFactory    = mr.StrictMock <IDialogFactory>();
            uiSvc         = mr.StrictMock <IDecompilerShellUiService>();
            memSvc        = mr.StrictMock <ILowLevelViewService>();
            disasmSvc     = mr.StrictMock <IDisassemblyViewService>();
            typeLibSvc    = mr.StrictMock <ITypeLibraryLoaderService>();
            brSvc         = mr.StrictMock <IProjectBrowserService>();
            uiPrefs       = mr.StrictMock <IUiPreferencesService>();
            fsSvc         = mr.StrictMock <IFileSystemService>();
            tcHostSvc     = mr.StrictMock <ITabControlHostService>();
            dcSvc         = mr.StrictMock <IDecompilerService>();
            srSvc         = MockRepository.GenerateMock <ISearchResultService, IWindowPane>();
            diagnosticSvc = MockRepository.GenerateMock <IDiagnosticsService, IWindowPane>();
            resEditSvc    = mr.StrictMock <IResourceEditorService>();
            loader        = mr.StrictMock <ILoader>();

            svcFactory.Stub(s => s.CreateArchiveBrowserService()).Return(archSvc);
            svcFactory.Stub(s => s.CreateDecompilerConfiguration()).Return(new FakeDecompilerConfiguration());
            svcFactory.Stub(s => s.CreateDiagnosticsService(Arg <ListView> .Is.Anything)).Return(diagnosticSvc);
            svcFactory.Stub(s => s.CreateDecompilerService()).Return(dcSvc);
            svcFactory.Stub(s => s.CreateDisassemblyViewService()).Return(disasmSvc);
            svcFactory.Stub(s => s.CreateMemoryViewService()).Return(memSvc);
            svcFactory.Stub(s => s.CreateDecompilerEventListener()).Return(new FakeDecompilerEventListener());
            svcFactory.Stub(s => s.CreateInitialPageInteractor()).Return(new FakeInitialPageInteractor());
            svcFactory.Stub(s => s.CreateLoadedPageInteractor()).Return(new FakeLoadedPageInteractor());
            svcFactory.Stub(s => s.CreateTypeLibraryLoaderService()).Return(typeLibSvc);
            svcFactory.Stub(s => s.CreateProjectBrowserService(Arg <ITreeView> .Is.NotNull)).Return(brSvc);
            svcFactory.Stub(s => s.CreateUiPreferencesService()).Return(uiPrefs);
            svcFactory.Stub(s => s.CreateFileSystemService()).Return(fsSvc);
            svcFactory.Stub(s => s.CreateShellUiService(Arg <IMainForm> .Is.NotNull, Arg <DecompilerMenus> .Is.NotNull)).Return(uiSvc);
            svcFactory.Stub(s => s.CreateTabControlHost(Arg <TabControl> .Is.NotNull)).Return(tcHostSvc);
            svcFactory.Stub(s => s.CreateLoader()).Return(loader);
            svcFactory.Stub(s => s.CreateSearchResultService(Arg <ListView> .Is.NotNull)).Return(srSvc);
            svcFactory.Stub(s => s.CreateResourceEditorService()).Return(resEditSvc);
            services.AddService(typeof(IDialogFactory), dlgFactory);
            services.AddService(typeof(IServiceFactory), svcFactory);

            form = mr.StrictMock <IMainForm>();
            var listView       = new ListView();
            var imagelist      = new ImageList();
            var tabResults     = new TabPage();
            var tabDiagnostics = new TabPage();
            var tabControl     = new TabControl {
                TabPages = { tabResults, tabDiagnostics }
            };
            var toolStrip   = new ToolStrip {
            };
            var statusStrip = new StatusStrip {
                Items = { new ToolStripLabel() }
            };
            var projectBrowser = mr.Stub <ITreeView>();

            form.Stub(f => f.DiagnosticsList).Return(listView);
            form.Stub(f => f.ImageList).Return(imagelist);
            form.Stub(f => f.Menu).SetPropertyAndIgnoreArgument();
            form.Stub(f => f.AddToolbar(null)).IgnoreArguments();
            form.Stub(f => f.Dispose());
            form.Stub(f => f.TabControl).Return(tabControl);
            form.Stub(f => f.FindResultsPage).Return(tabResults);
            form.Stub(f => f.DiagnosticsPage).Return(tabDiagnostics);
            form.Stub(f => f.FindResultsList).Return(listView);
            form.Stub(f => f.ToolBar).Return(toolStrip);
            form.Stub(f => f.ProjectBrowser).Return(projectBrowser);
            form.Stub(f => f.StatusStrip).Return(statusStrip);
            form.Load += null;
            LastCall.IgnoreArguments();
            form.Closed += null;
            LastCall.IgnoreArguments();
            form.ProcessCommandKey += null;
            LastCall.IgnoreArguments();
            dlgFactory.Stub(d => d.CreateMainForm()).Return(form);
            tcHostSvc.Stub(t => t.Attach(Arg <IWindowPane> .Is.NotNull, Arg <TabPage> .Is.NotNull));
            tcHostSvc.Stub(t => t.QueryStatus(
                               Arg <CommandID> .Is.Anything,
                               Arg <CommandStatus> .Is.Anything,
                               Arg <CommandText> .Is.Anything)).Return(false);
            tcHostSvc.Stub(t => t.Execute(Arg <CommandID> .Is.Anything)).Return(false);

            uiSvc.Stub(u => u.DocumentWindows).Return(new List <IWindowFrame>());
        }
Exemple #29
0
 public AskIfAddAnotherProductTask(IDialogFactory dialogFactory)
 {
     _dialogFactory = dialogFactory;
 }
 public CmdBaseTest(IProjectManager projectManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager)
     : base(projectManager, dialogFactory, projectConfigurationManager)
 {
 }
Exemple #31
0
 public AGSGameFactory(IGraphicsFactory graphics, IInventoryFactory inventory, IUIFactory ui,
                       IRoomFactory room, IOutfitFactory outfit, IObjectFactory obj, IDialogFactory dialog,
                       IAudioFactory sound, IFontLoader fontFactory)
 {
     Graphics  = graphics;
     Inventory = inventory;
     UI        = ui;
     Room      = room;
     Outfit    = outfit;
     Object    = obj;
     Dialog    = dialog;
     Sound     = sound;
     Fonts     = fontFactory;
 }
Exemple #32
0
        private SaveToArasCmd(IProjectManager projectManager, IAuthenticationManager authManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, ICodeProviderFactory codeProviderFactory, MessageManager messageManager) : base(authManager, dialogFactory, projectManager, projectConfigurationManager, codeProviderFactory, messageManager)
        {
            if (projectManager.CommandService != null)
            {
                var itemCommandID = new CommandID(ItemCommandSet, ItemCommandId);
                var itemMenu      = new OleMenuCommand(this.ExecuteCommand, itemCommandID);
                itemMenu.BeforeQueryStatus += CheckCommandAccessibility;

                projectManager.CommandService.AddCommand(itemMenu);
            }
        }
Exemple #33
0
 public DialogService(IDialogFactory dialogFactory)
 {
     _dialogFactory = dialogFactory;
 }
Exemple #34
0
 public DebugDialog(IDialogFactory dialogFactory)
 {
     this.dialogFactory = dialogFactory;
 }
        private OpenFromPackageCmd(IProjectManager projectManager, IAuthenticationManager authManager, IDialogFactory dialogFactory, IProjectConfigurationManager projectConfigurationManager, ICodeProviderFactory codeProviderFactory, MessageManager messageManager)
            : base(projectManager, dialogFactory, projectConfigurationManager, messageManager)
        {
            if (authManager == null)
            {
                throw new ArgumentNullException(nameof(authManager));
            }
            if (projectConfigurationManager == null)
            {
                throw new ArgumentNullException(nameof(projectConfigurationManager));
            }
            if (codeProviderFactory == null)
            {
                throw new ArgumentNullException(nameof(codeProviderFactory));
            }

            this.authManager         = authManager;
            this.codeProviderFactory = codeProviderFactory;

            if (projectManager.CommandService != null)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                var menuItem      = new OleMenuCommand(this.ExecuteCommand, menuCommandID);
                menuItem.BeforeQueryStatus += CheckCommandAccessibility;

                projectManager.CommandService.AddCommand(menuItem);
            }
        }
Exemple #36
0
 public SaveDialogService(IDialogFactory factory)
 {
     _factory = factory;
 }