/// <summary> /// Initializes a new instance of the <see cref="UpdateUserViewModel"/> class. /// </summary> /// <param name="user">The user.</param> public UpdateUserViewModel() : base() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IUserSessionComponent>(); this.UpdateCommand = new RelayCommand(() => this.UpdateUser(), () => this.CanUpdateUser()); this.CancelCommand = new RelayCommand(() => this.Close()); }
/// <summary> /// Initializes a new instance of the <see cref="UpdateUserViewModel"/> class. /// </summary> /// <param name="user">The user.</param> public UpdateUserViewModel() : base() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IUserSessionComponent>(); this.UpdateCommand = new RelayCommand(() => this.UpdateUser(), () => this.CanUpdateUser()); this.CancelCommand = new RelayCommand(() => this.Close()); }
public ChangePasswordViewModel() { this.IsPopupOpened = false; if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance <IUserSessionComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IUserSessionComponent>(); } this.SaveCommand = new RelayCommand(() => this.Save(), () => this.CanSave()); this.OpenPopupCommand = new RelayCommand(() => this.IsPopupOpened = true); }
public ChangePasswordViewModel() { this.IsPopupOpened = false; if (!Designer.IsDesignMode) { this.component = PluginContext.ComponentFactory.GetInstance<IUserSessionComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IUserSessionComponent>(); } this.SaveCommand = new RelayCommand(() => this.Save(), () => this.CanSave()); this.OpenPopupCommand = new RelayCommand(() => this.IsPopupOpened = true); }
public ConnectionViewModel() : base() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IUserSessionComponent>(); this.Users = new ObservableCollection <SecurityUserDto>(); this.ConnectCommand = new RelayCommand(() => this.Connect()); this.NavigateAddUserCommand = new RelayCommand(() => ViewService.Manager.ShowDialog <AddUserViewModel>()); this.Refresh(); }
public ConnectionViewModel() : base() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IUserSessionComponent>(); this.Users = new ObservableCollection<SecurityUserDto>(); this.ConnectCommand = new RelayCommand(() => this.Connect()); this.NavigateAddUserCommand = new RelayCommand(() => ViewService.Manager.ShowDialog<AddUserViewModel>()); this.Refresh(); }
/// <summary> /// Initialises this plugin. Basicaly it should configure the menus into the PluginHost /// Every task that could throw exception should be in this method and not in the ctor. /// </summary> public override void Initialise() { this.ConfigureAutoMapper(); this.ConfigureViewService(); this.component = PluginContext.ComponentFactory.GetInstance <IUserSessionComponent>(); TranslateExtension.ResourceManager = Messages.ResourceManager; var splitter = PluginContext.Host.GetMenuInHome("add", Groups.Tools); var splitterExist = true; if (splitter == null || splitter.GetType() != typeof(RibbonMenuButtonData)) { splitterExist = false; splitter = new RibbonMenuButtonData(Messages.Btn_Add, uri.FormatWith("Add"), null) { Order = 1, Name = "add", }; } var addButton = new RibbonMenuItemData(Messages.Title_ButtonAddUser, uri.FormatWith("Add"), this.addUserCommand) { Order = 3, }; (splitter as RibbonMenuButtonData).ControlDataCollection.Add(addButton); if (!splitterExist) { PluginContext.Host.AddInHome((splitter as RibbonMenuButtonData), Groups.Tools); } var navigateButton = new RibbonButtonData(Messages.Title_Deconnection , uri.FormatWith("Administration") , this.DisconnectCommand) { Order = int.MaxValue - 1 }; PluginContext.Host.AddToApplicationMenu(navigateButton); this.InitialiseConnectionPage(); this.InitialiseUpdateUserPage(); }
public UserSession() : base() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IUserSessionComponent>(); this.BuildCommands(); }
public UserSession() : base() { PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IUserSessionComponent>(); this.BuildCommands(); }
/// <summary> /// Initialises this plugin. Basicaly it should configure the menus into the PluginHost /// Every task that could throw exception should be in this method and not in the ctor. /// </summary> public override void Initialise() { this.ConfigureAutoMapper(); this.ConfigureViewService(); this.component = PluginContext.ComponentFactory.GetInstance<IUserSessionComponent>(); TranslateExtension.ResourceManager = Messages.ResourceManager; var splitter = PluginContext.Host.GetMenuInHome("add", Groups.Tools); var splitterExist = true; if (splitter == null || splitter.GetType() != typeof(RibbonMenuButtonData)) { splitterExist = false; splitter = new RibbonMenuButtonData(Messages.Btn_Add, uri.FormatWith("Add"), null) { Order = 1, Name = "add", }; } var addButton = new RibbonMenuItemData(Messages.Title_ButtonAddUser, uri.FormatWith("Add"), this.addUserCommand) { Order = 3, }; (splitter as RibbonMenuButtonData).ControlDataCollection.Add(addButton); if (!splitterExist) PluginContext.Host.AddInHome((splitter as RibbonMenuButtonData), Groups.Tools); var navigateButton = new RibbonButtonData(Messages.Title_Deconnection , uri.FormatWith("Administration") , this.DisconnectCommand) { Order = int.MaxValue - 1 }; PluginContext.Host.AddToApplicationMenu(navigateButton); this.InitialiseConnectionPage(); this.InitialiseUpdateUserPage(); }