示例#1
0
        private void btnWriteFiles_Click(object sender, EventArgs e)
        {
            this.WaitCursor(true);

            // dateien suchen
            if (this.files == null)
            {
                FindFiles();
            }


            Dictionary <string, MassWorkingFile> workingfiles = new Dictionary <string, MassWorkingFile>();

            foreach (TagEntry tagentry in this.tags.Tags.Values)
            {
                if (tagentry.Text != tagentry.NewText)
                {
                    foreach (MassWorkingFile f in tagentry.Files)
                    {
                        if (!workingfiles.ContainsKey(f.Filename))
                        {
                            workingfiles.Add(f.Filename, f);
                        }
                        MassWorkingFile mwf = workingfiles[f.Filename];

                        mwf.AddJob(this.selectedTag.Key, this.selectedTag.Repeatable, tagentry.Text, tagentry.NewText.Trim());
                    }
                }
            }

            this.ProgressBarMaximum = workingfiles.Count;

            foreach (MassWorkingFile f in workingfiles.Values)
            {
                f.ProcessJobs();
                this.ProgressBarValue++;
            }

            // dateilist löschen
            if (!this.chkCaching.Checked)
            {
                ClearFiles();
            }

            foreach (TagEntry tagentry in this.tags.Tags.Values)
            {
                if (tagentry.Text != tagentry.NewText)
                {
                    tagentry.Text = tagentry.NewText;
                }
            }

            DisplayGrid();

            this.ProgressBarMaximum = 0;
            this.WaitCursor(false);
        }
 public void RegisterFile(MassWorkingFile file)
 {
     if (field.Repeatable)
     {
         foreach (string s in file.MetaData.ListRepeatableAttribute(field.Key))
         {
             AddTag(s, file);
         }
     }
     else
     {
         AddTag(file.MetaData.getStringAttribute(field.Key), file);
     }
 }
        private void AddTag(string tag, MassWorkingFile f)
        {
            if (tag == "")
            {
                return;
            }

            TagEntry e;

            if (tags.ContainsKey(tag))
            {
                e = tags[tag];
            }
            else
            {
                e = new TagEntry(tag);
                this.tags.Add(tag, e);
            }

            e.AddFile(f);
        }
示例#4
0
 public void AddFile(MassWorkingFile file)
 {
     this.files.Add(file);
 }