예제 #1
0
        private bool LoadPreviousTags()
        {
            const bool EMPTY_CURRENT_TAGS = false;

            for (int i = 0; i < doneActions.Count; i++)
            {
                SortAction action = doneActions.ElementAt(i);

                //Search through doneActions for the most recent "Move" action that will have the previously used tags in it.
                if (action.GetType() == typeof(Move))
                {
                    if (EMPTY_CURRENT_TAGS)
                    {
                        while (EnabledTags.Count > 0)
                        {
                            EnabledTags.Clear();
                        }
                    }

                    /*for (int t = 0; t < (action as Move).tags.Length; t++)
                     * {
                     *  EnabledTags.Add((action as Move).tags[t]);
                     * }*/

                    EnabledTags.AddRange((action as Move).tags);

                    // The most recent move action was found and the tags were loaded.
                    return(true);
                }
            }

            // No recent move action was found and no tags were loaded.
            return(false);
        }
예제 #2
0
        //TODO: Add more checks for the fileIndex being equal to or less than current fileIndex and changing behaviour.
        public void RemoveFile(int fileIndex)
        {
            if (fileIndex == this.fileIndex)
            {
                form.mediaViewer.UnloadMedia(true);
            }

            files.RemoveAt(fileIndex);

            //while (EnabledTags.Count > 0)
            //EnabledTags.RemoveAt(0);

            EnabledTags.Clear();

            note = String.Empty;

            UpdateFileIndex(fileIndex);

            form.ValidateChildren();
        }