public SharepointServerSourceViewModel(SharepointServerSource serverSource, IEnvironmentModel environment) { IsLoading = false; TestComplete = false; _environment = environment; ServerName = ""; AuthenticationType = AuthenticationType.Windows; IsWindows = true; SaveCommand = new RelayCommand(o => { serverSource.DialogResult = true; serverSource.Close(); }, o => TestComplete); CancelCommand = new RelayCommand(o => { serverSource.DialogResult = false; serverSource.Close(); }); TestCommand = new RelayCommand(o => { IsLoading = true; Dev2JsonSerializer serializer = new Dev2JsonSerializer(); var source = CreateSharepointServerSource(); var comsController = new CommunicationController { ServiceName = "TestSharepointServerService" }; comsController.AddPayloadArgument("SharepointServer", serializer.SerializeToBuilder(source)); TestResult = comsController.ExecuteCommand<string>(environment.Connection, GlobalConstants.ServerWorkspaceID); IsLoading = false; }, o => !TestComplete); }
public SharepointServerSourceViewModel(SharepointServerSource serverSource, IEnvironmentModel environment) { IsLoading = false; TestComplete = false; _environment = environment; ServerName = ""; AuthenticationType = AuthenticationType.Windows; IsWindows = true; SaveCommand = new RelayCommand(o => { serverSource.DialogResult = true; serverSource.Close(); }, o => TestComplete); CancelCommand = new RelayCommand(o => { serverSource.DialogResult = false; serverSource.Close(); }); TestCommand = new RelayCommand(o => { IsLoading = true; Dev2JsonSerializer serializer = new Dev2JsonSerializer(); var source = CreateSharepointServerSource(); var comsController = new CommunicationController { ServiceName = "TestSharepointServerService" }; comsController.AddPayloadArgument("SharepointServer", serializer.SerializeToBuilder(source)); var sharepointSourceTo = comsController.ExecuteCommand <SharepointSourceTo>(environment.Connection, GlobalConstants.ServerWorkspaceID); TestResult = sharepointSourceTo.TestMessage; IsSharepointOnline = sharepointSourceTo.IsSharepointOnline; IsLoading = false; }, o => !TestComplete); }