예제 #1
0
        void CmdOkClick(object sender, EventArgs e)
        {
            if (_searchList2.Count > 0)
            {
                _il.DirClear();
                foreach (string fName in _searchList2)
                {
                    _il._imList.Add(new ImgFile(fName, DateTime.MinValue, DateTime.MinValue));
                }

                if (listSearch.SelectedItems.Count > 0)
                {
                    _selImg = listSearch.SelectedItems[0].Text;
                }
                else
                {
                    _selImg = "";
                }
                _SearchReturn = true;
            }
            this.Close();
        }
예제 #2
0
 public void     FRefreshDir()
 {
     _il.DirClear();
     FPicScan(_currentPath, false);
     FPicLoad(_currentPath, true);
 }
예제 #3
0
		public void ProcessDrop(string[] files, bool allDirs)
		{
			int picCount = 0;
			int dirCount = 0;
			Array.Sort(files);

			string loadFile = "";
			_il.DirClear();
			foreach (string dropFile in files)
			{
				string dropDir = "";
				if (File.Exists(dropFile)) {
					if (_il.FileIsValid(dropFile)){
						picCount++;
						_il.DirPicAdd(dropFile);     // for multi file drop
						dropDir = Path.GetDirectoryName(dropFile);
						loadFile = dropFile;
					}
					else{
						string ext = Path.GetExtension(dropFile).ToLower();
						MessageBox.Show(String.Format(T._("File type {0} not supported"), ext), T._("Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
					}
				}
				else if (Directory.Exists(dropFile)){ // is dir
					dirCount++;
					dropDir = dropFile;
					loadFile = dropFile;
					//Debug.WriteLine("drop dir " + dropDir);
				}
				else if (dropDir  == ""){
					MessageBox.Show(T._("No drop dir"), T._("Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				}
			}  // end for

			if (picCount == 1) {
				_picSelection = T._("Directory:");
				PicScan(loadFile, allDirs, 0);
			}
			else if (picCount > 0){
				_picSelection = T._("Selection:");
				// pic list already loaded
			}
			else if (dirCount > 0){
				_picSelection = T._("Directory:");
				PicScan(loadFile, allDirs, 1);  // rescan for lower
			}
			else {
				//MessageBox.Show("No drop selection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
			}

			if (loadFile != ""){
				if (File.Exists(loadFile)) {
					PicLoadPos(loadFile, true);
					SetCommand('r', loadFile);
				}
				// else load with RunWorkerCompleted
			}
			else {
				picBox.Image = null;
				SetStatusText(0, T._("No image loaded"));
			}
		}