public void Accept()
        {
            ServerGroupName = ServerGroupName.Trim();

            if (base.HasValidationErrors)
            {
                base.ShowValidation(true);
            }
            else
            {
                if (!_isNewServerGroup)
                {
                    var serverGroup = (IServerTreeGroup)_serverTree.CurrentNode;
                    serverGroup.Name = _serverGroupName;
                }
                else
                {
                    var serverGroup = new ServerTreeGroup(_serverGroupName);
                    ((ServerTreeGroup)_serverTree.CurrentNode).AddChild(serverGroup);
                    _serverTree.CurrentNode = serverGroup;
                }

                _serverTree.Save();
                _serverTree.FireServerTreeUpdatedEvent();

                this.ExitCode = ApplicationComponentExitCode.Accepted;
                Host.Exit();
            }
        }
Esempio n. 2
0
        internal static ServerTreeGroup ToServerTreeGroup(this StoredServerGroup storedServerGroup, List<ApplicationEntity> servers)
        {
            var serverTreeGroup = new ServerTreeGroup(storedServerGroup.Name);
            foreach (var childGroup in storedServerGroup.ChildGroups)
                serverTreeGroup.ChildGroups.Add(childGroup.ToServerTreeGroup(servers));

            foreach (var directoryServerReference in storedServerGroup.DirectoryServerReferences)
            {
                var reference = directoryServerReference;
                var foundServerIndex = servers.FindIndex(d => d.Name == reference.Name);
                if (foundServerIndex >= 0)
                {
                    var server = (IApplicationEntity)servers[foundServerIndex];
                    servers.RemoveAt(foundServerIndex);
                    serverTreeGroup.Servers.Add(new ServerTreeDicomServer(server));
                }
            }

            return serverTreeGroup;
        }
Esempio n. 3
0
        internal static ServerTreeGroup ToServerTreeGroup(this StoredServerGroup storedServerGroup, List <ApplicationEntity> servers)
        {
            var serverTreeGroup = new ServerTreeGroup(storedServerGroup.Name);

            foreach (var childGroup in storedServerGroup.ChildGroups)
            {
                serverTreeGroup.ChildGroups.Add(childGroup.ToServerTreeGroup(servers));
            }

            foreach (var directoryServerReference in storedServerGroup.DirectoryServerReferences)
            {
                var reference        = directoryServerReference;
                var foundServerIndex = servers.FindIndex(d => d.Name == reference.Name);
                if (foundServerIndex >= 0)
                {
                    var server = (IApplicationEntity)servers[foundServerIndex];
                    servers.RemoveAt(foundServerIndex);
                    serverTreeGroup.Servers.Add(new ServerTreeDicomServer(server));
                }
            }

            return(serverTreeGroup);
        }
Esempio n. 4
0
 private void InitializeRootGroup()
 {
     RootServerGroup = new ServerTreeGroup(@"My Servers");
 }
Esempio n. 5
0
 private void InitializeRootGroup()
 {
     RootServerGroup = new ServerTreeGroup(@"My Servers");
 }