public MemberViewModel(MemberProfile member, IServerUrl serverUrl, IAuthorizationService authorizator) { this.authorizator = authorizator; ServerUrl = serverUrl; MemberProfile = member; SendEmailCommand = new DelegateCommand(SendEmail); }
public LoginViewModel( [Import(typeof(IEventAggregator))] IEventAggregator aggregator, [Import(typeof(IBackgroundExecutor))] IBackgroundExecutor executor, [Import(typeof(IAuthorizationService))] IAuthorizationService authorizator, [Import(typeof(IDialogService))] IDialogService dialogService, [Import] IServerUrl serverUrl, [ImportMany(typeof(Services.AuthProviders.IOAuthProvider))] IEnumerable<Services.AuthProviders.IOAuthProvider> providers) { this.aggregator = aggregator; this.executor = executor; this.authorizator = authorizator; this.dialogs = dialogService; this.serverUrl = serverUrl; AllProviders = providers.OrderBy(p =>p.ProviderName); aggregator.Subscribe(ScrumFactoryEvent.ShellStarted, TryToSignIn); aggregator.Subscribe(ScrumFactoryEvent.NotAuthorizedServerExceptionThrowed, TryToSignIn); aggregator.Subscribe(ScrumFactoryEvent.ShowLogin, Show); aggregator.Subscribe<string>(ScrumFactoryEvent.ServerArgOnInit, OnSetupServer); SignInCommand = new DelegateCommand<Services.AuthProviders.IOAuthProvider>(CanSignIn, p => { p.SignOut(); SignIn(p); }); SetDemoServerCommand = new DelegateCommand(SetDemoServer); SetStandAloneServerCommand = new DelegateCommand(SetStandAloneServer); SetCompanyServerCommand = new DelegateCommand(SetCompanyServer); ShowServerPanelCommand = new DelegateCommand(() => { ShowServerSelection = true; IsServerUrlVisible = false; }); ShowProviderPanelCommand = new DelegateCommand(() => { ShowServerSelection = false; }); ServerUrl = Properties.Settings.Default.serverUrl; System.Windows.Application.Current.Exit += Current_Exit; if (Properties.Settings.Default.lastLoginWasLocal) StartLocalServer(); }
public CommonApiRepository(IServerUrl url) { _uri = url.GetServerUrl(); _httpClient = new HttpClient(); }