本文整理汇总了C#中IApplicationCommands类的典型用法代码示例。如果您正苦于以下问题:C# IApplicationCommands类的具体用法?C# IApplicationCommands怎么用?C# IApplicationCommands使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IApplicationCommands类属于命名空间,在下文中一共展示了IApplicationCommands类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FlyoutService
public FlyoutService(IRegionManager regionManager, IApplicationCommands applicationCommands)
{
_regionManager = regionManager;
ShowFlyoutCommand = new DelegateCommand<string>(ShowFlyout, CanShowFlyout);
applicationCommands.ShowFlyoutCommand.RegisterCommand(ShowFlyoutCommand);
}
示例2: ShellViewModel
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 + ")";
}
示例3: InvokePatternWrapper
/// -------------------------------------------------------------------
/// <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);
}
示例4: ScrollItemPatternWrapper
/// -------------------------------------------------------------------
/// <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;
}
示例5: LeftMenuService
public LeftMenuService(IServiceLocator serviceLocator, IApplicationCommands commands)
{
this.commands = commands;
this.serviceLocator = serviceLocator;
MenuItems = new ObservableCollection<IMenuViewItem>();
}
示例6: PersonDetailsViewModel
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);
}
示例7: ShellTitlebarRightWindowCommandsViewModel
/// <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);
}
示例8: MultipleViewTests
/// -------------------------------------------------------------------
/// <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);
}
示例9: TableItemTests
/// -------------------------------------------------------------------
/// <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);
}
示例10: SelectionPatternWrapper
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;
}
示例11: TogglePatternWrapper
/// -------------------------------------------------------------------
/// <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);
}
示例12: ViewBViewModel
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);
}
示例13: MenuItemViewModel
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));
}
示例14: BrokerEditViewModel
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");
}
示例15: TextScenarioTests
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);
}