Exemplo n.º 1
0
 internal virtual void GetResult(Ookii.Dialogs.Wpf.Interop.IFileDialog dialog)
 {
     if( !GetOption(NativeMethods.FOS.FOS_ALLOWMULTISELECT) )
     {
         _fileNames = new string[1];
         Ookii.Dialogs.Wpf.Interop.IShellItem result;
         dialog.GetResult(out result);
         result.GetDisplayName(NativeMethods.SIGDN.SIGDN_FILESYSPATH, out _fileNames[0]);
     }
 }
 private void GetResult(Ookii.Dialogs.Wpf.Interop.IFileDialog dialog)
 {
     Ookii.Dialogs.Wpf.Interop.IShellItem item;
     dialog.GetResult(out item);
     item.GetDisplayName(NativeMethods.SIGDN.SIGDN_FILESYSPATH, out _selectedPath);
 }
        private void GetResult(Ookii.Dialogs.Interop.IFileDialog dialog)
        {
            if (Multiselect)
            {
                Ookii.Dialogs.Interop.IShellItemArray results;
                ((Ookii.Dialogs.Interop.IFileOpenDialog)dialog).GetResults(out results);
                uint count;
                results.GetCount(out count);
                string[] selectedPaths = new string[count];
                for (uint x = 0; x < count; ++x)
                {
                    Ookii.Dialogs.Interop.IShellItem item;
                    results.GetItemAt(x, out item);
                    string name;
                    item.GetDisplayName(NativeMethods.SIGDN.SIGDN_FILESYSPATH, out name);
                    selectedPaths[x] = name;
                }
                _selectedPaths = selectedPaths;

            }
            else
            {
                Ookii.Dialogs.Interop.IShellItem item;
                dialog.GetResult(out item);
                item.GetDisplayName(NativeMethods.SIGDN.SIGDN_FILESYSPATH, out _selectedPaths[0]);
            }
        }