示例#1
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);
        }
示例#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);
        }
 public PatrolPatternEditControl(PatrolPattern pattern)
     : this()
 {
     SetPattern(pattern);
 }
 public void SetPattern(PatrolPattern source)
 {
     Name = source.Name;
     currentPattern = source;
     currentBoards = source.TargetBoards;
     targetBoardsListBox.Items.AddRange(currentBoards.ToArray());
     //targetBoardsListBox.DisplayMember = "Name";
     //boardsTextBox.Source = currentBoards;
     SetParameters(source.Pattern,
      source.NGPattern,
         //source.IsIgnorePattern,
      source.SubFolderFormat,
      source.Name,
      source.EnableJpg,
      source.EnablePng,
      source.EnableGif,
      source.EnableBmp,
      source.EnableZip);
 }
示例#5
0
 //public event EventHandler<PatrolPatternChangedEventArgs> PatternChanged;
 //public event EventHandler<GenreFolderChangedEventArgs> FolderChanged;
 public void Add(PatrolPattern pattern)
 {
     throw new NotImplementedException();
     //GenreFolder targetFolder = FindParentFolder(pattern);
     //if (targetFolder != null)
     //{
     //    targetFolder.Add(pattern);
     //}
 }
示例#6
0
 public void Remove(PatrolPattern pattern)
 {
     throw new NotImplementedException();
     //GenreFolder parent = FindParentFolder(pattern);
     //if (parent != null)
     //{
     //    parent.Remove(pattern);
     //}
 }
示例#7
0
 //private GenreFolder FindParentFolder(PatrolPattern child)
 //{
 //    if (child == null)
 //    {
 //        throw new ArgumentNullException("pattern");
 //    }
 //    return this.FirstOrDefault(folder => folder.Equals(child.ParentFolder));
 //}
 public void Contains(PatrolPattern pattern)
 {
     throw new NotImplementedException();
 }