public ServerDetailsViewModel(Server server, IPhysicalModel physicalModel) { this.server = server; this.physicalModel = physicalModel; Endpoints = new BindableCollection<GuiEndpoint>(GetEndpointsFromPhysicalModel()); }
public ServerDetailsViewModel(Server server, IPhysicalModel physicalModel) { this.server = server; this.physicalModel = physicalModel; Endpoints = new BindableCollection <GuiEndpoint>(GetEndpointsFromPhysicalModel()); }
public void SetUp() { physicalModel = MockRepository.GenerateMock <IPhysicalModel>(); var endpoints = GenerateListOfEndpoints(); physicalModel.Stub(x => x.Endpoints).Return(endpoints); }
public void SetUp() { physicalModel = MockRepository.GenerateMock<IPhysicalModel>(); var endpoints = GenerateListOfEndpoints(); physicalModel.Stub(x => x.Endpoints).Return(endpoints); }
public ServerViewModel(IPhysicalModel physicalModel, IServiceLocator serviceLocator) { this.physicalModel = physicalModel; this.serviceLocator = serviceLocator; //Servers = new BindableCollection<Server>(this.physicalModel.Servers()); ServerViews = new BindableCollection <ServerDetailsViewModel>(OpenAllScreens()); }
public static IEnumerable <Server> Servers(this IPhysicalModel physicalModel) { var groupedServers = physicalModel.Endpoints.GroupBy(x => x.ServerName); foreach (var server in groupedServers) { yield return(new Server { Name = server.Key }); } }
//Note: GuiEndpoint? public static IEnumerable <GuiEndpoint> EndpointsOnServer(this IPhysicalModel physicalModel, string serverName) { var endpoints = physicalModel.Endpoints.Where(x => x.ServerName == serverName); //Todo: AutoMapper? foreach (var endpoint in endpoints) { yield return(new GuiEndpoint { Id = endpoint.Id, HostType = endpoint.HostType, Status = endpoint.Status.ToString() }); } }
// METHODS public Mesh GenerateMesh(IPhysicalModel model, MeshProperties props) { Mesh mesh = null; FileInfo fileInfo = new FileInfo(gmshExecutionPath); if (fileInfo.Exists) { DateTime now = DateTime.Now; string prefix = $"{now.Year}-{now.Month}-{now.Day}--{now.Hour}-{now.Minute}-{now.Second}-{now.Millisecond}"; string geometryFile = Path.Combine(fileInfo.DirectoryName, $"{prefix}.geo"); string meshFile = Path.Combine(fileInfo.DirectoryName, $"{prefix}.msh"); GenerateGeometryFile(geometryFile, model.GetSurfaces(), props); ExecuteGmsh(geometryFile, meshFile); mesh = ReadMeshFile(meshFile); } return(mesh); }
public EndpointsViewModel(IPhysicalModel physicalModel) { this.physicalModel = physicalModel; Endpoints = new BindableCollection <GuiEndpoint>(ConvertEndPoints()); }
public ServerViewModel(IPhysicalModel physicalModel) { this.physicalModel = physicalModel; RefreshServersFromPhysicalModel(); }
public EndpointsViewModel(IPhysicalModel physicalModel) { this.physicalModel = physicalModel; Endpoints = new BindableCollection<GuiEndpoint>(ConvertEndPoints()); }
public TopologySnapshotMessageHandler(IPhysicalModel physicalModel) { this.physicalModel = physicalModel; }