Example #1
0
        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();
            }
        }
        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);
        }
Example #3
0
 private void InitializeRootGroup()
 {
     RootServerGroup = new ServerTreeGroup(@"My Servers");
 }