Ejemplo n.º 1
0
        private void AddDuctFittingAndAccessoryPressureDropServers()
        {
            MultiServerService service = ExternalServiceRegistry.GetService(ExternalServices.BuiltInExternalServices.DuctFittingAndAccessoryPressureDropService) as MultiServerService;

            if (service == null)
            {
                return;
            }

            List <Guid> activeServerIds = new List <Guid>();

            // User table server is the default server, and it's already set to active, so it should be set active again.
            Duct.UserTableDuctPressureDropServer UserTableServer = new Duct.UserTableDuctPressureDropServer();
            if (UserTableServer != null)
            {
                service.AddServer(UserTableServer);
                activeServerIds.Add(UserTableServer.GetServerId());
            }



            IList <Guid> currentActiveServerIds = service.GetActiveServerIds();

            // currentActiveServerIds.Remove(service.GetDefaultServerId());
            activeServerIds.AddRange(currentActiveServerIds);
            service.SetActiveServers(activeServerIds);
        }
        private void AddDuctFittingAndAccessoryPressureDropServers()
        {
            MultiServerService service = ExternalServiceRegistry.GetService(ExternalServices.BuiltInExternalServices.DuctFittingAndAccessoryPressureDropService) as MultiServerService;
             if (service == null)
            return;

             List<Guid> activeServerIds = new List<Guid>();

             // User table server is the default server, and it's already set to active, so it should be set active again.
             Duct.UserTableDuctPressureDropServer UserTableServer = new Duct.UserTableDuctPressureDropServer();
             if (UserTableServer != null)
             {
            service.AddServer(UserTableServer);
            activeServerIds.Add(UserTableServer.GetServerId());
             }

             IList<Guid> currentActiveServerIds = service.GetActiveServerIds();
            // currentActiveServerIds.Remove(service.GetDefaultServerId());
             activeServerIds.AddRange(currentActiveServerIds);
             service.SetActiveServers(activeServerIds);
        }