예제 #1
0
        /// <summary>
        /// Reload a file, insert it into the file list at the specified index, view it, and reload the given tags and notes.
        /// </summary>
        public void ReloadFile(string filename, int fileIndex, string[] tags = null, string note = null)
        {
            fileIndex = (fileIndex < 0) ? 0 : fileIndex;
            fileIndex = (fileIndex > files.Count) ? files.Count : fileIndex;

            files.Insert(fileIndex, filename);

            UpdateFileIndex(fileIndex);

            if (tags != null)
            {
                while (EnabledTags.Count > 0)
                {
                    EnabledTags.RemoveAt(0);
                }

                foreach (string tag in tags)
                {
                    EnabledTags.Add(tag);
                }
            }

            if (note != null)
            {
                this.note = note;
            }

            form.ValidateChildren();
        }
예제 #2
0
 public void ToggleTag(string tag)
 {
     if (EnabledTags.Contains(tag))
     {
         EnabledTags.Remove(tag);
     }
     else
     {
         EnabledTags.Add(tag);
     }
 }