Beispiel #1
0
 public StartViewVM(IDialogService dialogService, IFileService fileService, IBookService bookService, IApplicationCommands applicationCommands)
 {
     _dialogService       = dialogService;
     _fileService         = fileService;
     _bookService         = bookService;
     _applicationCommands = applicationCommands;
 }
Beispiel #2
0
        private void InitializeCommands(IApplicationCommands commands)
        {
            var showWindowCommand = new DelegateCommand(() => ShowWindow());

            commands.ShowWindowCommand.RegisterCommand(showWindowCommand);

            var hideWindowCommand = new DelegateCommand(() => HideWindow());

            commands.HideWindowCommand.RegisterCommand(hideWindowCommand);

            var showHideWindowCommand = new DelegateCommand(() =>
            {
                if (IsVisible && WindowState != WindowState.Minimized)
                {
                    HideWindow();
                }
                else
                {
                    ShowWindow();
                }
            });

            commands.ShowHideWindowCommand.RegisterCommand(showHideWindowCommand);

            var closeWindowCommand = new DelegateCommand(() => Application.Current.Shutdown());

            commands.CloseWindowCommand.RegisterCommand(closeWindowCommand);
        }
        public AppStateInfoViewModel(
            IApplicationCommands applicationCommands,
            IEventAggregator eventAggregator,
            IAppConfigurationService appConfigurationService,
            IKeyHookService keyHookService,
            IStorageService storageService)
        {
            KeyHookService          = keyHookService;
            ApplicationCommands     = applicationCommands;
            EventAggregator         = eventAggregator;
            AppConfigurationService = appConfigurationService;
            StorageService          = storageService;

            tokenKeyHandlerHome = KeyHookService.Add(System.Windows.Forms.Keys.Home, () => ApplicationCommands.ToggleWindowVisibility.Execute(null));
            tokenKeyHandlerEnd  = KeyHookService.Add(System.Windows.Forms.Keys.End, () => ApplicationCommands.ToggleWindowVisibility.Execute(null));

            //handle "unload" event from view to cleanup VM resources
            EventAggregator.GetEvent <ViewDestroyedEvent>()
            .Subscribe(
                HandleUnload,
                ThreadOption.UIThread,
                false,
                view => view.DataContext == this     //if view has this context then handle operation
                );
        }
        public FlyoutService(IRegionManager regionManager, IApplicationCommands applicationCommands)
        {
            _regionManager = regionManager;

            ShowFlyoutCommand = new DelegateCommand<string>(ShowFlyout, CanShowFlyout);
            applicationCommands.ShowFlyoutCommand.RegisterCommand(ShowFlyoutCommand);
        }
Beispiel #5
0
        public LeftMenuService(IServiceLocator serviceLocator, IApplicationCommands commands)
        {
            this.commands = commands;
            this.serviceLocator = serviceLocator;

            MenuItems = new ObservableCollection<IMenuViewItem>();
        }
        public FlyoutService(IRegionManager regionManager, IApplicationCommands applicationCommands)
        {
            _regionManager = regionManager;

            ShowFlyoutCommand = new DelegateCommand <string>(ShowFlyout, CanShowFlyout);
            applicationCommands.ShowFlyoutCommand.RegisterCommand(ShowFlyoutCommand);
        }
        public ShellViewModel(
            IRegionManager regionManager, 
            IEventAggregator eventAggregator, 
            INavigationService navigationService, 
            IApplicationCommands applicationCommands, 
            LogWriter logWriter)
        {
            this.regionManager = regionManager;
            this.eventAggregator = eventAggregator;
            this.navigationService = navigationService;
            this.applicationCommands = applicationCommands;
            this.logWriter = logWriter;
            this.EntitySelectorViews = new List<KeyValuePair<string, Type>>();
            this.ExitCommand = new DelegateCommand<object>(this.AppExit, this.CanAppExit);
            this.eventAggregator.Subscribe<BusyEvent>(this.SetBusy);
            this.eventAggregator.Subscribe<DialogOpenEvent>(this.DialogOpened);
            this.eventAggregator.Subscribe<StatusEvent>(this.UpdateStatus);
            this.eventAggregator.Subscribe<ErrorEvent>(this.ShowError);
            this.eventAggregator.Subscribe<CanSaveEvent>(this.UpdateCanSave);
            this.eventAggregator.Subscribe<EntitySelectEvent>(this.ShowSelectEntity);
            this.eventAggregator.Subscribe<EntitySelectedEvent>(this.HideSelectEntity);
            this.eventAggregator.Subscribe<MappingUpdateEvent>(this.ShowUpdateMapping);
            this.eventAggregator.Subscribe<MappingUpdatedEvent>(this.HideUpdateMapping);
            this.eventAggregator.Subscribe<CanCreateNewChangeEvent>(this.CanCreateNewChange);
            this.eventAggregator.Subscribe<CanCloneChangeEvent>(this.CanCloneChange);
            this.eventAggregator.Subscribe<ConfirmMappingDeleteEvent>(this.ConfirmMappingDelete);
            this.eventAggregator.Subscribe<MappingDeleteConfirmedEvent>(this.MappingDeleteConfirmed);
            this.NewEntityMenuItems = new ObservableCollection<MenuItemViewModel>();

            this.serverList = new ObservableCollection<string>();
            this.SetServerList();

            this.HelpToolTip = "Help Documentation (" + Assembly.GetExecutingAssembly().GetName().Version + ")";
        }
Beispiel #8
0
 /// -------------------------------------------------------------------
 /// <summary></summary>
 /// -------------------------------------------------------------------
 internal InvokePatternWrapper(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
     :
     base(element, testSuite, priority, typeOfControl, typeOfPattern, dirResults, testEvents, commands)
 {
     Comment("Calling GetPattern(InvokePattern) on " + Library.GetUISpyLook(element));
     m_pattern = (InvokePattern)GetPattern(m_le, m_useCurrent, InvokePattern.Pattern);
 }
Beispiel #9
0
        public LeftMenuViewModel(IRegionManager regionManager, IApplicationCommands applicationCommands)
        {
            _regionManager = regionManager;

            ApplicationCommands = applicationCommands;

            NavigateCommand = new DelegateCommand <string>(Navigate);

            GoHomeCommand = new DelegateCommand(GoHome);

            GoProcessCommand = new DelegateCommand(GoProcess);

            GoWIPCommand = new DelegateCommand(GoWIp);

            GoReprotCommand = new DelegateCommand(GoReport);

            GoServiceCommand = new DelegateCommand(GoService);

            ReportParameterCommand = new DelegateCommand(ReportParmameter);

            ReportProcessReportCommand = new DelegateCommand(ReportProcess);

            ReportWIPReportCommand = new DelegateCommand(ReportWIP);

            ReportAuditTrailCommand = new DelegateCommand(ReportAuditTrail);

            ReportProcessRecipeCommand = new DelegateCommand(ReportProcessRecipe);

            ReportWIPRecipeCommand = new DelegateCommand(ReportWIPRecipe);


            _applicationCommands.HiddeCompositeCommand.RegisterCommand(NavigateCommand);
            _applicationCommands.ShowCompositeCommand.RegisterCommand(NavigateCommand);
        }
Beispiel #10
0
        public MainViewModel(IContainerExtension container, IApplicationCommands appCommands)
        {
            _appData    = container.Resolve <AppData>();
            AppCommands = appCommands;

            InitCommand();
        }
Beispiel #11
0
        /// <summary>Initializes a new instance of the <see cref="ContentService" /> class.</summary>
        /// <param name="regionManager">The region manager.</param>
        /// <param name="applicationCommands">The application commands.</param>
        public ContentService(IRegionManager regionManager, IApplicationCommands applicationCommands)
        {
            this.regionManager = regionManager;

            ShowContentCommand = new DelegateCommand <string>(ShowContent, CanShowContent);
            applicationCommands.ShowContentCommand.RegisterCommand(ShowContentCommand);
        }
 public NavigationBarDefaultViewModel(IRegionManager manager, IEventAggregator ea, IApplicationCommands applicationCommands)
 {
     _regionManager       = manager;
     _ea                  = ea;
     _applicationCommands = applicationCommands;
     _applicationCommands.Navigate.RegisterCommand(Navigate);
 }
 public MainWindow(IApplicationCommands applicationCommands, IRegionManager regionManager)
 {
     _applicationCommands = applicationCommands;
     InitializeComponent();
     RegionManager.SetRegionName(HamburgerMenuContent, RegionNames.ContentRegion);
     RegionManager.SetRegionManager(HamburgerMenuContent, regionManager);
 }
Beispiel #14
0
 public MainWindowViewModel(IRegionManager regionManager, IApplicationCommands applicationCommands, IEventAggregator eventAggregator)
 {
     Title            = "Prism MahApps.Metro Demo";
     _regionManager   = regionManager;
     _eventAggregator = eventAggregator;
     applicationCommands.NavigateCommand.RegisterCommand(NavigateCommand);
 }
Beispiel #15
0
        public CalendarGroupViewModel(XamScheduleDataManager dataManager, ICalendarService calendarService, IEventAggregator eventAggragator, IApplicationCommands applicationCommands)
        {
            CalendarUnselectedCommand         = new DelegateCommand <object>(CalendarUnselectedCommandExecuted);
            DateNavigatorSelectedDatesCommand = new DelegateCommand <ObservableCollection <DateTime> >(OnDateNavigatorSelectedDates);

            CalendarService = calendarService;
            EventAggregator = eventAggragator;

            ApplicationCommands = applicationCommands;

            DataManager = dataManager;

            GenerateMenu();

            _unselectedCalendarChangedEvent = EventAggregator.GetEvent <UnselectedCalendarChangedEvent>();
            _selectedCalendarChangedEvent   = eventAggragator.GetEvent <SelectedCalendarChangedEvent>();
            _selectedCalendarChangedEvent.Subscribe(OnSelectedCalendarChanged);

            _calendarClosedEvent = EventAggregator.GetEvent <CalendarClosedEvent>();
            _calendarClosedEvent.Subscribe(OnCalendarClosed);

            _dateNavigatorSelectedDatesChanged = EventAggregator.GetEvent <DateNavigatorSelectedDatesChanged>();

            _outlookDateNavigatorSelectedDatesChanged = EventAggregator.GetEvent <OutlookDateNavigatorSelectedDatesChanged>();
            _outlookDateNavigatorSelectedDatesChanged.Subscribe(OnOutlookDateNavigatorSelectedDatesChanged);
            _canExecuteDateNavigatorSelectedDatesCommand = true;
        }
        public LeftMenuService(IServiceLocator serviceLocator, IApplicationCommands commands)
        {
            this.commands       = commands;
            this.serviceLocator = serviceLocator;

            MenuItems = new ObservableCollection <IMenuViewItem>();
        }
        public MainWindow(IApplicationCommands applicationCommands)
        {
            InitializeComponent();

            ThemeManager.ApplicationTheme = new Office2013Theme();
            _applicationCommands          = applicationCommands;
        }
        public CompositeCommandTabbedPageViewModel(INavigationService navigationService
                                                   , IApplicationCommands applicationCommands) : base(navigationService)
        {
            ApplicationCommands = applicationCommands;

            Title = "CompositeCommand";
        }
        public PersonDetailsViewModel(
            IEventAggregator eventAggregator,
            IPersonRepository repository,
            IApplicationCommands applicationCommands,
            IRegionManager regionManager)
        {
            this.regionManager = regionManager;
            this.eventAggregator = eventAggregator;
            this.repository = repository;
            this.SaveConfirmation = new InteractionRequest<IConfirmation>();
            ;

            eventAggregator.GetEvent<PersonSelectionEvent>()
                .Subscribe(this.OnPersonSelected, ThreadOption.PublisherThread);

            this.CreateNewCommand = new DelegateCommand(() => this.SelectedPerson = new Person());
            applicationCommands.NewCommand.RegisterCommand(this.CreateNewCommand);

            this.SaveCommand = new DelegateCommand(this.Save, this.CanSave);
            applicationCommands.SaveCommand.RegisterCommand(this.SaveCommand);

            this.GenerateNumbersCommand = new DelegateCommand(this.GenerateNumbers);

            this.ShowAnalyzationCommand = new DelegateCommand(this.ShowAnalyzation);
        }
Beispiel #20
0
        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -------------------------------------------------------------------
        internal ScrollItemPatternWrapper(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
            :
            base(element, testSuite, priority, typeOfControl, typeOfPattern, dirResults, testEvents, commands)
        {
            Comment("Creating ScrollItemTests");

            _pattern = (ScrollItemPattern)GetPattern(m_le, m_useCurrent, ScrollItemPattern.Pattern);
            if (_pattern == null)
                ThrowMe(CheckType.IncorrectElementConfiguration, Helpers.PatternNotSupported + ": ScrollItemPattern");

            // Find the ScrollPattern
            _container = m_le;

            while (_container != null && !(bool)_container.GetCurrentPropertyValue(AutomationElement.IsScrollPatternAvailableProperty))
                _container = TreeWalker.ControlViewWalker.GetParent(_container);

            // Check to see if we actual found the container of the scrollitem
            if (_container == null)
                ThrowMe(CheckType.IncorrectElementConfiguration, "Element does not have a container with ScrollPattern");

            Comment("Found scroll container: " + Library.GetUISpyLook(_container));

            _scrollPattern = (ScrollPattern)_container.GetCurrentPattern(ScrollPattern.Pattern) as ScrollPattern;

        }
Beispiel #21
0
 public MainWindowViewModel(
     IRegionManager regionManager,
     IApplicationCommands applicationCommands)
 {
     NavigateCommand      = new DelegateCommand <string>(Navigate);
     _regionManager       = regionManager;
     _applicationCommands = applicationCommands;
 }
        public SettingsViewModel(ISettingService settingService, IApplicationCommands applicationCommands)
        {
            this.settingService      = settingService;
            this.applicationCommands = applicationCommands;
            this.SaveCommand         = new DelegateCommand(Save).ObservesCanExecute(() => this.CanSave);

            this.applicationCommands.SaveCommand.RegisterCommand(this.SaveCommand);
        }
Beispiel #23
0
        public MainWindowViewModel(IApplicationCommands applicationCommands)
        {
            ApplicationCommands = applicationCommands;

            var updateCommand = new DelegateCommand(Update);

            _applicationCommands.SaveCommand.RegisterCommand(updateCommand);
        }
Beispiel #24
0
		/// -------------------------------------------------------------------
		/// <summary>
        /// Get the TableItemPattern on the element
        /// </summary>
		/// -------------------------------------------------------------------
		public TableItemTests(AutomationElement element, TestPriorities priority, string dirResults, bool testEvents, TypeOfControl typeOfControl, IApplicationCommands commands)
            :
            base(element, TestSuite, priority, typeOfControl, TypeOfPattern.TableItem, dirResults, testEvents, commands)
        {
            m_pattern = (TableItemPattern)GetPattern(m_le, m_useCurrent, TableItemPattern.Pattern);
            if (m_pattern == null)
                throw new Exception(Helpers.PatternNotSupported);
        }
Beispiel #25
0
        public MainWindowVM(IApplicationCommands applicationCommands)
        {
            Title      = (string)Application.Current.Resources["Program_Name"];
            Visibility = Visibility.Visible;

            applicationCommands.HideShellCommand.RegisterCommand(HideCommand);
            applicationCommands.ShowShellCommand.RegisterCommand(ShowCommand);
        }
Beispiel #26
0
        public ShellViewModel(IApplicationCommands applicationCommands)
        {
            this.applicationCommands = applicationCommands;
            SaveAllCommand           = applicationCommands.SaveAllCommand;

            this.TabItemsSource = NavigationManager.GetOrCreateSharedSource <TabViewModel>();
            this.Load();
        }
		/// -------------------------------------------------------------------
		/// <summary></summary>
		/// -------------------------------------------------------------------
		public MultipleViewTests(AutomationElement element, TestPriorities priority, string dirResults, bool testEvents, TypeOfControl typeOfControl, IApplicationCommands commands)
            :
            base(element, TestSuite, priority, typeOfControl, TypeOfPattern.MultipleView, dirResults, testEvents, commands)
        {
            m_pattern = (MultipleViewPattern)element.GetCurrentPattern(MultipleViewPattern.Pattern);
            if (m_pattern == null)
                throw new Exception(Helpers.PatternNotSupported);
        }
        /// <summary>
        /// CTOR
        /// </summary>
        public ShellTitlebarRightWindowCommandsViewModel(IApplicationCommands applicationCommands)
        {
            this.ShowApplicationHelpCommand = new DelegateCommand(this.ShowApplicationHelp);
            this.ShowApplicationInfoCommand = new DelegateCommand(this.ShowApplicationInfo);

            applicationCommands.ShowApplicationHelpCommand.RegisterCommand(this.ShowApplicationHelpCommand);
            applicationCommands.ShowApplicationInfoCommand.RegisterCommand(this.ShowApplicationInfoCommand);
        }
        /// <summary>
        /// CTOR
        /// </summary>
        public ShellTitlebarRightWindowCommandsViewModel(IApplicationCommands applicationCommands)
        {
            this.ShowApplicationHelpCommand = new DelegateCommand(this.ShowApplicationHelp);
            this.ShowApplicationInfoCommand = new DelegateCommand(this.ShowApplicationInfo);

            applicationCommands.ShowApplicationHelpCommand.RegisterCommand(this.ShowApplicationHelpCommand);
            applicationCommands.ShowApplicationInfoCommand.RegisterCommand(this.ShowApplicationInfoCommand);
        }
Beispiel #30
0
        public TabViewModel(IApplicationCommands applicationCommands)
        {
            _applicationCommands = applicationCommands;

            UpdateCommand = new DelegateCommand(Update).ObservesCanExecute(() => CanUpdate);

            _applicationCommands.SaveCommand.RegisterCommand(UpdateCommand);
        }
 public CalendarViewModel(IEventAggregator ea, IApplicationCommands applicationCommands)
 {
     Week         = new Week();
     WeekSchedule = new WeekSchedule();
     _ea          = ea;
     _ea.GetEvent <UpdateMenuEvent>().Subscribe(UpdateMenu_Handler);
     _applicationCommands = applicationCommands;
 }
Beispiel #32
0
        public EditorControlViewModel(IEventAggregator eventAggregator, IApplicationCommands appCommands)
        {
            _eventAggregator = eventAggregator;
            _appCommands     = appCommands;

            InitEvent();
            InitCommand();
            InitCodeCompletionParser();
        }
Beispiel #33
0
        public ShellViewModel(ISettingsService settingsService, IRegionManager regionManager, IApplicationCommands applicationCommands)
        {
            settingsService.LoadSettings();

            RegionManager = regionManager;

            ApplicationCommands = applicationCommands;
            applicationCommands.NavigateCommand.RegisterCommand(NavigateCommand);
        }
        public FlyoutService(IRegionManager regionManager, IApplicationCommands applicationCommands)
        {
            _regionManager       = regionManager;
            _applicationCommands = applicationCommands;

            this.ShowFlyoutCommand = new DelegateCommand <string>(ShowFlyout);
            //注册子命令给全局复合命令
            _applicationCommands.ShowCommand.RegisterCommand(this.ShowFlyoutCommand);
        }
        //Constructor
        public RecordEntryBindableBase(IApplicationCommands applicationCommands)
        {
            _applicationCommands = applicationCommands;

            SaveCommand = new DelegateCommand(SaveEntry);
            applicationCommands.SaveCompCommand.RegisterCommand(SaveCommand);
            DeleteCommand = new DelegateCommand(DeleteEntry);
            applicationCommands.DeleteCompCommand.RegisterCommand(DeleteCommand);
        }
Beispiel #36
0
        public Shell(IRegionManager regionManager, IApplicationCommands commands)
        {
            InitializeComponent();

            RegionManager.SetRegionName(HamburgerMenuContent, RegionNames.ContentRegion);
            RegionManager.SetRegionManager(HamburgerMenuContent, regionManager);

            InitializeCommands(commands);
        }
Beispiel #37
0
        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -------------------------------------------------------------------
        protected TogglePatternWrapper(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
            :
            base(element, testSuite, priority, typeOfControl, typeOfPattern, dirResults, testEvents, commands)
        {
            _pattern = (TogglePattern)element.GetCurrentPattern(TogglePattern.Pattern);

            if (_pattern == null)
                throw new Exception("TogglePattern: " + Helpers.PatternNotSupported);
        }
Beispiel #38
0
        public EventPublisherViewModel(IEventAggregator eventAggregator, IApplicationCommands applicationCommands)
        {
            this.eventAggregator = eventAggregator;

            Title = GetModuleTitle(Assembly.GetExecutingAssembly());

            PublishCommand = new DelegateCommand(Publish);
            applicationCommands.MainCommand.RegisterCommand(MainCommand);
        }
Beispiel #39
0
        bool _Contiguous; //calendar only accept contigious selection

        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -------------------------------------------------------------------
        internal SelectionPatternWrapper(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
            :
            base(element, testSuite, priority, typeOfControl, typeOfPattern, dirResults, testEvents, commands)
        {
            _pattern = (SelectionPattern)GetPattern(m_le, m_useCurrent, SelectionPattern.Pattern);

            ControlType ct = m_le.GetCurrentPropertyValue(AutomationElement.ControlTypeProperty) as ControlType;
            _Contiguous = ct == ControlType.Calendar;
        }
        public EditorControlViewModel(IContainerExtension container, IEventAggregator eventAggregator, IApplicationCommands appCommands)
        {
            _xsdParser       = container.Resolve <XsdParser>();
            _eventAggregator = eventAggregator;
            _appCommands     = appCommands;

            InitEvent();
            InitCommand();
        }
Beispiel #41
0
 public HomeViewModel(IEventAggregator ea, IApplicationCommands applicationCommands)
 {
     Message  = "View A from your Prism Module";
     Plans    = new ObservableCollection <Models.Plan>();
     Proverbs = "  View A from your Prism ModuleView A from your Prism ModuleView A from your Prism ModuleView A from your Prism ModuleView A from your Prism Module";
     _ea      = ea;
     _ea.GetEvent <UpdateMenuEvent>().Subscribe(UpdateMenu_Handler);
     _applicationCommands = applicationCommands;
 }
Beispiel #42
0
        public ViewBViewModel(INavigationService navigationService, IApplicationCommands applicationCommands)
        {
            _navigationService = navigationService;
            NavigateCommand = new DelegateCommand(Navigate).ObservesCanExecute((vm) => CanNavigate);
            SaveCommand = new DelegateCommand(Save);
            ResetCommand = new DelegateCommand(Reset);

            applicationCommands.SaveCommand.RegisterCommand(SaveCommand);
            applicationCommands.ResetCommand.RegisterCommand(ResetCommand);
        }
 public MenuItemViewModel(
     IApplicationCommands commands, 
     INavigationService navigationService, 
     IEventAggregator eventAggregator)
 {
     this.eventAggregator = eventAggregator;
     this.OpenCommand =
         new DelegateCommand(
             () => commands.OpenView(this.SearchResultsViewType, this.name, RegionNames.MainSearchResultsRegion));
     this.AddEntityCommand = new DelegateCommand(() => navigationService.NavigateMain(this.AddEntityUri));
 }
 public BrokerEditViewModel(
     IEventAggregator eventAggregator, 
     IMdmService entityService, 
     INavigationService navigationService, 
     IMappingService mappingService, 
     IApplicationCommands applicationCommands)
 {
     this.navigationService = navigationService;
     this.mappingService = mappingService;
     this.applicationCommands = applicationCommands;
     this.eventAggregator = eventAggregator;
     this.entityService = entityService;
     this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
     this.CanEdit = AuthorisationHelpers.HasEntityRights("Broker");
 }
Beispiel #45
0
 public TextScenarioTests(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
     :
     base(element, testSuite, priority, TypeOfControl.UnknownControl, TypeOfPattern.Unknown, null, testEvents, commands)
 {
     try
     {
         _tth = new TextTestsHelper(element, testSuite, priority, TypeOfControl.UnknownControl, TypeOfPattern.Unknown, null, testEvents, commands);
     }
     catch( Exception ex )
     {
         supportsText = false;
         Comment("Unknown exception raised: " + ex.ToString() );
     }
     _NotifiedEvent = new System.Threading.ManualResetEvent(false);
 }
 public SourceSystemEditCloneViewModel(
     IEventAggregator eventAggregator, 
     IMdmService entityService, 
     INavigationService navigationService, 
     IMappingService mappingService, 
     IApplicationCommands applicationCommands)
 {
     this.navigationService = navigationService;
     this.mappingService = mappingService;
     this.applicationCommands = applicationCommands;
     this.eventAggregator = eventAggregator;
     this.entityService = entityService;
     this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
     this.CanEdit = AuthorisationHelpers.HasEntityRights("SourceSystem");
     this.eventAggregator.Subscribe<MappingClonedEvent>(this.MappingCloned);
 }
        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -------------------------------------------------------------------
        internal SelectionItemPatternWrapper(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
            :
            base(element, testSuite, priority, typeOfControl, typeOfPattern, dirResults, testEvents, commands)
        {
            _pattern = (SelectionItemPattern)GetPattern(m_le, m_useCurrent, SelectionItemPattern.Pattern);
            if (_pattern == null)
                throw new Exception(Helpers.PatternNotSupported + ": SelectionItemPattern");

            _selectionContainer = _pattern.Current.SelectionContainer;

            if (_selectionContainer != null)
            {
                _selectionPattern = _selectionContainer.GetCurrentPattern(SelectionPattern.Pattern) as SelectionPattern;
                if (_selectionPattern == null)
                    throw new ArgumentException("Could not find the SelectionContainer's SelectionPattern");
            }

        }
        public LegalEntityEditViewModel(
            IEventAggregator eventAggregator, 
            IMdmService entityService, 
            INavigationService navigationService, 
            IMappingService mappingService, 
            IApplicationCommands applicationCommands, 
            IList<string> partystatusConfiguration)
        {
            this.navigationService = navigationService;
            this.mappingService = mappingService;
            this.applicationCommands = applicationCommands;
            this.eventAggregator = eventAggregator;
            this.entityService = entityService;
            this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
            this.CanEdit = AuthorisationHelpers.HasEntityRights("LegalEntity");

            this.PartyStatusConfiguration = partystatusConfiguration;
        }
        public SearchViewModel(
            IEventAggregator eventAggregator, 
            IApplicationCommands applicationCommands, 
            INavigationService navigationService, 
            IMappingService mappingService)
        {
            this.eventAggregator = eventAggregator;
            this.applicationCommands = applicationCommands;
            this.navigationService = navigationService;
            this.mappingService = mappingService;
            this.MenuItems = new ObservableCollection<MenuItemViewModel>();

            this.DisplayWelcome = true;
            this.AsOf = SystemTime.UtcNow().Date;

            this.SourceSystems = SourceSystemList(this.mappingService);

            this.SourceSystem = string.Empty;
        }
        public LocationEditCloneViewModel(
            IEventAggregator eventAggregator, 
            IMdmService entityService, 
            INavigationService navigationService, 
            IMappingService mappingService, 
            IApplicationCommands applicationCommands, 
            IList<string> typeConfiguration)
        {
            this.navigationService = navigationService;
            this.mappingService = mappingService;
            this.applicationCommands = applicationCommands;
            this.eventAggregator = eventAggregator;
            this.entityService = entityService;
            this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
            this.CanEdit = AuthorisationHelpers.HasEntityRights("Location");
            this.eventAggregator.Subscribe<MappingClonedEvent>(this.MappingCloned);

            this.TypeConfiguration = typeConfiguration;
        }
Beispiel #51
0
        internal TextWrapper(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
            :
            base(element, testSuite, priority, typeOfControl, typeOfPattern, dirResults, testEvents, commands)
        {
            if (m_le == null)
                throw new ArgumentException("m_le cannot be null");

            _pattern = (TextPattern)m_le.GetCurrentPattern(TextPattern.Pattern);
            _frameworkId = ((string)m_le.GetCurrentPropertyValue(AutomationElement.FrameworkIdProperty)).ToLower(CultureInfo.InvariantCulture);
            _testPriority = TestPriorities.BuildVerificationTest; // default value

            // Determine if tests currently running on Windows Vista
            NativeMethods.OSVERSIONINFOEX ver = new NativeMethods.OSVERSIONINFOEX();
            UnsafeNativeMethods.GetVersionEx(ver);
            if (ver.majorVersion >= 6) // This should account for Windows Vista + Service Packs
                _windowsVista = true;   // It may also occur for Vienna, but the expectation is things
            else                        // could change so much post-Vista, that TextPattern tests will
                _windowsVista = false;  // have to be revisited anyway ((i.e. we will likely be moving to un-managed client)

            Comment("Operating System Version = " + ver.majorVersion + "." + ver.minorVersion + "." + ver.buildNumber);
        }
 public AvalonTextScenarioTests(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
     :
     base(element, testSuite, priority, TypeOfControl.UnknownControl, TypeOfPattern.Unknown, null, testEvents, commands)
 {
     _NotifiedEvent = new System.Threading.ManualResetEvent(false);
 }
Beispiel #53
0
 /// -------------------------------------------------------------------
 /// <summary></summary>
 /// -------------------------------------------------------------------
 public SelectionTests(AutomationElement element, TestPriorities priority, string dirResults, bool testEvents, TypeOfControl typeOfControl, IApplicationCommands commands)
     :
     base(element, TestSuite, priority, typeOfControl, TypeOfPattern.Selection, dirResults, testEvents, commands)
 {
 }
		/// -------------------------------------------------------------------
		/// <summary></summary>
		/// -------------------------------------------------------------------
		internal ExpandCollapsePatternWrapper(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
            :
            base(element, testSuite, priority, typeOfControl, typeOfPattern, dirResults, testEvents, commands)
        {
            m_pattern = (ExpandCollapsePattern)GetPattern(m_le, m_useCurrent, ExpandCollapsePattern.Pattern);
        }
Beispiel #55
0
 /// -------------------------------------------------------------------
 /// <summary></summary>
 /// -------------------------------------------------------------------
 public TopLevelEventsScenarioTests(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
     :
     base(element, testSuite, priority, TypeOfControl.UnknownControl, TypeOfPattern.Unknown, null, testEvents, commands)
 {
 }
Beispiel #56
0
        /// -------------------------------------------------------------------
        /// <summary>
        /// Main driver code that calls the actual tests.  This method will 
        /// continue call the tests until either the test application has gone 
        /// away, or the thread is aborted.
        /// </summary>
        /// -------------------------------------------------------------------
        StressTestsDrivers(PacketInfo threadInfo)
        {
            //AutomationPattern[] patterns = null;
            PacketInfo ti = (PacketInfo)threadInfo;
            _originalElement = ti.AutomationElement;
            _appCommands = ti.AppCommands;
            _actionCount = ti.ActionCount;
            _applicationElement = ti.ApplicationElement;
            _curElement = _originalElement;
            _automationProperties = ti.AutomationProperties;
            _automationPatterns = ti.AutomationPatterns;
            UIA.AutomationElement element = null;
            MethodInfo method = null;
            ArrayList methodList = null;
            
            // Build the table that will reference all the methods in this assembly 
            // that has a StressBuckets custom attribute defined.
            BuildMethodsTable(ti.TestLab, TestWorks.Stable, ti.Scenario);

            BuildElementTable(_originalElement);

            // Loop and run actions
            for (int actionCount = 0; ; actionCount++)
            {
                try
                {
                    string patternName = string.Empty;

                    // TODO: How to set wieghts?  Currently it is uniform.  Need to make AE run more often.
                    if (_rnd.Next(_patterns.Count + 1) == _patterns.Count)
                    {
                        patternName = "AutomationElement";
                    }
                    else
                    {
                        patternName = (string)_patterns[_rnd.Next(_patterns.Count)];
                    }

                    // Is there a ArrayList of methods associated with the pattern?
                    if (null != (methodList = (ArrayList)(_testMethods[patternName])))
                    {
                        // Find a specific test in the patterns collection...
                        if (null != (method = (MethodInfo)methodList[_rnd.Next(methodList.Count)]))
                        {
                            // If the test has set it;s 
                            if (Stable(method.Name, ti.TestLab))
                            {
                                element = GetRandomObjectByType(patternName);

                                // If we found an element that supports the pattern, then run the test
                                if (null != (element = GetRandomObjectByType(patternName)))
                                {
                                    ti.AppCommands.TraceMethod(method.Name);
#if PENTEST
                                    try
                                    {
#endif
                                        method.Invoke(this, new object[] { element });
#if PENTEST
                                    }
                                    catch (Exception)
                                    {
                                    }
#endif

                                }
                            }
                        }
                    }
                }
                // High level exceptions that can occur everywhere
                catch (ThreadAbortException)
                {
                    return;
                }
                catch (System.ComponentModel.Win32Exception)
                {
                    // Hot key already registered
                }

            }
        }
Beispiel #57
0
		/// -------------------------------------------------------------------
		/// <summary></summary>
		/// -------------------------------------------------------------------
		public ThumbControlTests(AutomationElement element, TestPriorities priority, string dirResults, bool testEvents, IApplicationCommands commands)
            :
        base(element, TestSuite, priority, TypeOfControl.ThumbControl, dirResults, testEvents, commands)
        {
        }
Beispiel #58
0
 /// -------------------------------------------------------------------
 /// <summary>Constructor of object to pass to the thread</summary>
 /// -------------------------------------------------------------------
 public PacketInfo(
     UIA.AutomationElement applicationElement,
     UIA.AutomationElement element,
     IApplicationCommands appCommands,
     TestLab testLab,
     int actionCount,
     ArrayList automationProperties,
     ArrayList automationPatterns,
     Scenario scenario)
 {
     _applicationElement = applicationElement;
     _element = element;
     _appCommands = appCommands;
     _testLab = testLab;
     _actionCount = actionCount;
     _automationProperties = automationProperties;
     _automationPatterns = automationPatterns;
     _scenario = scenario;
     _testLab = testLab;
 }
Beispiel #59
0
        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -------------------------------------------------------------------
        public PatternObject(AutomationElement element, string testSuite, TestPriorities priority, TypeOfControl typeOfControl, TypeOfPattern typeOfPattern, string dirResults, bool testEvents, IApplicationCommands commands)
            :
		base (element, testSuite, priority, typeOfControl, typeOfPattern, dirResults, testEvents, commands)
        {
            _testCaseSampleType = TestCaseSampleType.Pattern;
        }
Beispiel #60
0
 /// -------------------------------------------------------------------
 /// <summary>Call this to initialize the class so that one can call the
 /// entry points depending on which framework is used</summary>
 /// -------------------------------------------------------------------
 public StressScenarioTests(UIA.AutomationElement element, bool testEvents, bool testChildren, int numThreads, TestLab testLab, IApplicationCommands commands)
     :
     base(element, null, TestPriorities.PriAll, TypeOfControl.UnknownControl, TypeOfPattern.Unknown, null, testEvents, commands)
 {
     _testChildren = testChildren;
     _numThreads = numThreads;
     _testLab = testLab;
     //PopulateAutomationElementProperties(ref _automationProperties, ref _automationPatterns);
 }