Esempio n. 1
0
 /// <summary>
 /// 指定した巡回設定を読み込みます
 /// </summary>
 /// <param name="table">指定する設定</param>
 public void Set(IPatrolTable source)
 {
     BeginUpdate();
     foreach (GenreFolder folder in source)
     {
         TreeNode folderNode = new TreeNode(folder.Name)
         {
             Tag = folder,
             Name = folder.Name,
             ImageIndex = PatrolPatternsEditForm.FolderImageIndex,
             SelectedImageIndex = PatrolPatternsEditForm.FolderImageIndex
         };
         foreach (PatrolPattern child in folder)
         {
             PatrolPatternEditControl patternControl = new PatrolPatternEditControl(child);
             patternControl.PatternNameChanged +=
                 new EventHandler<PatrolPatternNameChangedEventArgs>(patternControl_PatternNameChanged);
             TreeNode childNode = new TreeNode(child.Name)
             {
                 Name = child.Name,
                 Tag = patternControl,
                 ImageIndex = PatrolPatternsEditForm.PatternImageIndex,
                 SelectedImageIndex = PatrolPatternsEditForm.PatternImageIndex
             };
             folderNode.Nodes.Add(childNode);
         }
         Nodes.Add(folderNode);
     }
     EndUpdate();
 }
Esempio n. 2
0
        public void AddEmptyPattern(TreeNode targetNode)
        {
            GenreFolder parentFolder = (GenreFolder)targetNode.Tag;
            PatrolPattern emptyPattern = new PatrolPattern(parentFolder);
            if (ContainsPatternKey(emptyPattern.Name))
            {
                emptyPattern.Name = Rename(emptyPattern.Name);
            }

            PatrolPatternEditControl patternControl = new PatrolPatternEditControl(emptyPattern);
            patternControl.PatternNameChanged +=
                new EventHandler<PatrolPatternNameChangedEventArgs>(patternControl_PatternNameChanged);
            TreeNode emptyNode = new TreeNode(emptyPattern.Name)
            {
                Tag = patternControl,
                Name = emptyPattern.Name,
                ImageIndex = PatrolPatternsEditForm.PatternImageIndex,
                SelectedImageIndex = PatrolPatternsEditForm.PatternImageIndex
            };
            targetNode.Nodes.Add(emptyNode);
            OnPatternNodeAdded(emptyNode);
        }
Esempio n. 3
0
        public void AddPattern(TreeNode parentNode, PatrolPattern pattern)
        {
            GenreFolder parentFolder = (GenreFolder)parentNode.Tag;
            pattern.ParentFolder = parentFolder;
            if (ContainsPatternKey(pattern.Name))
            {
                pattern.Name = Rename(pattern.Name);
            }

            PatrolPatternEditControl patternControl = new PatrolPatternEditControl(pattern);
            patternControl.PatternNameChanged +=
                new EventHandler<PatrolPatternNameChangedEventArgs>(patternControl_PatternNameChanged);
            TreeNode patternNode = new TreeNode(pattern.Name)
            {
                Tag = patternControl,
                Name = pattern.Name,
                ImageIndex = PatrolPatternsEditForm.PatternImageIndex,
                SelectedImageIndex = PatrolPatternsEditForm.PatternImageIndex
            };
            parentNode.Nodes.Add(patternNode);
            OnPatternNodeAdded(patternNode);
        }