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();
            }
        }
예제 #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;
        }
예제 #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);
        }
예제 #4
0
 private void InitializeRootGroup()
 {
     RootServerGroup = new ServerTreeGroup(@"My Servers");
 }
예제 #5
0
파일: ServerTree.cs 프로젝트: nhannd/Xian
 private void InitializeRootGroup()
 {
     RootServerGroup = new ServerTreeGroup(@"My Servers");
 }