static Tuple <ManageNewServerSourceModel, IServer, QueryManagerProxy> BuildManageNewServerSourceModel() { ICommunicationControllerFactory factory = new CommunicationControllerFactory(); var instanceSource = ServerRepository.Instance.Source; var environmentConnection = instanceSource.Connection; var studioResourceUpdateManager = new StudioResourceUpdateManager(factory, environmentConnection); var queryManagerProxy = new QueryManagerProxy(factory, environmentConnection); var manageNewServerSourceModel = new ManageNewServerSourceModel(studioResourceUpdateManager, queryManagerProxy, Environment.MachineName); var tuple = Tuple.Create(manageNewServerSourceModel, instanceSource, queryManagerProxy); return(tuple); }
void Initialize(Guid id, IEnvironmentConnection environmentConnection, IResourceRepository resourceRepository) { VerifyArgument.IsNotNull("environmentConnection", environmentConnection); CanStudioExecute = true; EnvironmentID = id; Connection = environmentConnection; ResourceRepository = resourceRepository ?? new ResourceRepository(this); var communicationControllerFactory = new CommunicationControllerFactory(); _proxyLayer = new StudioServerProxy(communicationControllerFactory, Connection); UpdateRepository = new StudioResourceUpdateManager(communicationControllerFactory, Connection); Connection.PermissionsModified += RaisePermissionsModifiedEvent; Connection.NetworkStateChanged += RaiseNetworkStateChangeEvent; Connection.ItemAddedMessageAction += ItemAdded; }
public void GivenWarewolfServerIsRunning() { var environmentModel = ServerRepository.Instance.Source; if (!environmentModel.IsConnected) { environmentModel.Connect(); } var controllerFactory = new CommunicationControllerFactory(); var environmentConnection = environmentModel.Connection; var manager = new StudioResourceUpdateManager (controllerFactory, environmentConnection); var proxyLayer = new StudioServerProxy(controllerFactory, environmentConnection); ScenarioContext.Current.Add("environmentModel", environmentModel); ScenarioContext.Current.Add("studioResourceUpdateManager", manager); ScenarioContext.Current.Add("proxyLayer", proxyLayer); }