Beispiel #1
0
        internal void RemoveFolder(FolderWrapper folderWrapper)
        {
            foreach (var parent in Model.Folders.Cast <FolderWrapper>())
            {
                if (parent == folderWrapper)
                {
                    Model.Folders.Remove(folderWrapper);
                    break;
                }

                if (RemoveFolder(parent, folderWrapper))
                {
                    break;
                }
            }
        }
Beispiel #2
0
        public void ImportFiles(string[] filepaths, string[] msgText, FolderWrapper folder)
        {
            // BatchImageProcessor.Model.Types.RawOptions overrideOptions = null;

            bool   bError = false;
            string sError = "", msg = "";

            int index = 0;

            foreach (var strfile in filepaths)
            {
                var f = new FileInfo(strfile);
                if (!f.Exists)
                {
                    bError = true;
                    sError = Resources.File_does_not_exist + ".\r\n" + strfile;
                    break; // Doesn't exist
                }

                //check for msg
                if (msgText != null)
                {
                    if (index < msgText.Length)
                    {
                        msg = msgText[index];  //it exists
                    }
                }

                if (msgText == null)
                {
                    folder.AddFile(strfile);
                }
                else
                {
                    this.MessageText = msg;
                    folder.AddFile(strfile, msg);
                }

                index++;
            }

            if (bError)
            {
                MessageBox.Show(sError, Resources.Import_Error);
            }
        }