public ServerDetailsViewModel(Server server, IPhysicalModel physicalModel)
        {
            this.server = server;
            this.physicalModel = physicalModel;

            Endpoints = new BindableCollection<GuiEndpoint>(GetEndpointsFromPhysicalModel());
        }
Пример #2
0
        public ServerDetailsViewModel(Server server, IPhysicalModel physicalModel)
        {
            this.server        = server;
            this.physicalModel = physicalModel;

            Endpoints = new BindableCollection <GuiEndpoint>(GetEndpointsFromPhysicalModel());
        }
Пример #3
0
        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);
        }
Пример #5
0
        public ServerViewModel(IPhysicalModel physicalModel, IServiceLocator serviceLocator)
        {
            this.physicalModel  = physicalModel;
            this.serviceLocator = serviceLocator;

            //Servers = new BindableCollection<Server>(this.physicalModel.Servers());

            ServerViews = new BindableCollection <ServerDetailsViewModel>(OpenAllScreens());
        }
Пример #6
0
        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
                });
            }
        }
Пример #7
0
        //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()
                });
            }
        }
Пример #8
0
        // 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);
        }
Пример #9
0
        public EndpointsViewModel(IPhysicalModel physicalModel)
        {
            this.physicalModel = physicalModel;

            Endpoints = new BindableCollection <GuiEndpoint>(ConvertEndPoints());
        }
Пример #10
0
        public ServerViewModel(IPhysicalModel physicalModel)
        {
            this.physicalModel = physicalModel;

            RefreshServersFromPhysicalModel();
        }
Пример #11
0
        public EndpointsViewModel(IPhysicalModel physicalModel)
        {
            this.physicalModel = physicalModel;

            Endpoints = new BindableCollection<GuiEndpoint>(ConvertEndPoints());
        }
Пример #12
0
        public ServerViewModel(IPhysicalModel physicalModel)
        {
            this.physicalModel = physicalModel;

            RefreshServersFromPhysicalModel();
        }
Пример #13
0
 public TopologySnapshotMessageHandler(IPhysicalModel physicalModel)
 {
     this.physicalModel = physicalModel;
 }