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

            Endpoints = new BindableCollection<GuiEndpoint>(GetEndpointsFromPhysicalModel());
        }
Esempio n. 2
0
        public ServerDetailsViewModel(Server server, IPhysicalModel physicalModel)
        {
            this.server        = server;
            this.physicalModel = physicalModel;

            Endpoints = new BindableCollection <GuiEndpoint>(GetEndpointsFromPhysicalModel());
        }
Esempio n. 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);
        }
Esempio n. 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());
        }
Esempio n. 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
                });
            }
        }
Esempio n. 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()
                });
            }
        }
Esempio n. 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);
        }
Esempio n. 9
0
        public EndpointsViewModel(IPhysicalModel physicalModel)
        {
            this.physicalModel = physicalModel;

            Endpoints = new BindableCollection <GuiEndpoint>(ConvertEndPoints());
        }
Esempio n. 10
0
        public ServerViewModel(IPhysicalModel physicalModel)
        {
            this.physicalModel = physicalModel;

            RefreshServersFromPhysicalModel();
        }
        public EndpointsViewModel(IPhysicalModel physicalModel)
        {
            this.physicalModel = physicalModel;

            Endpoints = new BindableCollection<GuiEndpoint>(ConvertEndPoints());
        }
Esempio n. 12
0
        public ServerViewModel(IPhysicalModel physicalModel)
        {
            this.physicalModel = physicalModel;

            RefreshServersFromPhysicalModel();
        }
Esempio n. 13
0
 public TopologySnapshotMessageHandler(IPhysicalModel physicalModel)
 {
     this.physicalModel = physicalModel;
 }