当前位置: 首页>>代码示例>>C#>>正文


C# IFileDialog类代码示例

本文整理汇总了C#中IFileDialog的典型用法代码示例。如果您正苦于以下问题:C# IFileDialog类的具体用法?C# IFileDialog怎么用?C# IFileDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IFileDialog类属于命名空间,在下文中一共展示了IFileDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnFileOk

 public HRESULT OnFileOk(IFileDialog pfd)
 {
     if( _dialog.DoFileOk(pfd) )
         return HRESULT.S_OK;
     else
         return HRESULT.S_FALSE;
 }
开发者ID:divyang4481,项目名称:lextudio,代码行数:7,代码来源:VistaFileDialogEvents.cs

示例2: OnTypeChange

 public void OnTypeChange(IFileDialog pfd)
 {
 }
开发者ID:MotorViper,项目名称:FormGenerator,代码行数:3,代码来源:WPFFolderBrowserDialog.cs

示例3: OnSelectionChange

 public void OnSelectionChange(IFileDialog pfd)
 {
 }
开发者ID:MotorViper,项目名称:FormGenerator,代码行数:3,代码来源:WPFFolderBrowserDialog.cs

示例4: OnFolderChanging

 public HRESULT OnFolderChanging(IFileDialog pfd, IShellItem psiFolder)
 {
     return HRESULT.S_OK;
 }
开发者ID:MotorViper,项目名称:FormGenerator,代码行数:4,代码来源:WPFFolderBrowserDialog.cs

示例5: OnOverwrite

 public void OnOverwrite(IFileDialog pfd, IShellItem psi, out NativeMethods.FDE_OVERWRITE_RESPONSE pResponse)
 {
     // TODO: Implement overwrite notification support
     pResponse = NativeMethods.FDE_OVERWRITE_RESPONSE.FDEOR_ACCEPT;
 }
开发者ID:ssickles,项目名称:archive,代码行数:5,代码来源:CommonFileDialog.cs

示例6: OnSelectionChange

 public void OnSelectionChange(IFileDialog pfd)
 {
     parent.OnSelectionChanged(EventArgs.Empty);
 }
开发者ID:ssickles,项目名称:archive,代码行数:4,代码来源:CommonFileDialog.cs

示例7: OnFolderChanging

 public HRESULT OnFolderChanging(IFileDialog pfd, IShellItem psiFolder)
 {
     CommonFileDialogFolderChangeEventArgs args =
         new CommonFileDialogFolderChangeEventArgs(parent.GetFileNameFromShellItem(psiFolder));
     if (!firstFolderChanged)
         parent.OnFolderChanging(args);
     return (args.Cancel ? HRESULT.S_FALSE : HRESULT.S_OK);
 }
开发者ID:ssickles,项目名称:archive,代码行数:8,代码来源:CommonFileDialog.cs

示例8: SyncFileTypeComboToDefaultExtension

        /// <summary>
        /// Tries to set the File(s) Type Combo to match the value in 
        /// 'DefaultExtension'.  Only doing this if 'this' is a Save dialog 
        /// as it makes no sense to do this if only Opening a file.
        /// </summary>
        /// 
        /// <param name="dialog">The native/IFileDialog instance.</param>
        /// 
        private void SyncFileTypeComboToDefaultExtension(IFileDialog dialog)
        {
            if (DefaultExtension == null ||
                filters.Count <= 0)
            {
                return;
            }

            CommonFileDialogFilter filter = null;

            for (uint filtersCounter = 0; filtersCounter < filters.Count; filtersCounter++)
            {
                filter = (CommonFileDialogFilter)filters[(int)filtersCounter];

                if (filter.Extensions.Contains(DefaultExtension))
                {
                    // set the docType combo to match this 
                    // extension. property is a 1-based index.
                    dialog.SetFileTypeIndex(filtersCounter + 1);

                    // we're done, exit for
                    break;
                }
            }

        }
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:34,代码来源:CommonFileDialog.cs

示例9: OnOverwrite

 public void OnOverwrite(IFileDialog pfd, IShellItem psi, out ShellNativeMethods.FileDialogEventOverwriteResponse pResponse)
 {
     // Don't accept or reject the dialog, keep default settings
     pResponse = ShellNativeMethods.FileDialogEventOverwriteResponse.Default;
 }
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:5,代码来源:CommonFileDialog.cs

示例10: OnShareViolation

 public void OnShareViolation(
     IFileDialog pfd,
     IShellItem psi,
     out ShellNativeMethods.FileDialogEventShareViolationResponse pResponse)
 {
     // Do nothing: we will ignore share violations, 
     // and don't register
     // for them, so this method should never be called.
     pResponse = ShellNativeMethods.FileDialogEventShareViolationResponse.Accept;
 }
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:10,代码来源:CommonFileDialog.cs

示例11: OnFolderChanging

            public HResult OnFolderChanging(IFileDialog pfd, IShellItem psiFolder)
            {
                CommonFileDialogFolderChangeEventArgs args = new CommonFileDialogFolderChangeEventArgs(
                    CommonFileDialog.GetFileNameFromShellItem(psiFolder));

                if (!firstFolderChanged) { parent.OnFolderChanging(args); }

                return (args.Cancel ? HResult.False : HResult.Ok);
            }
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:9,代码来源:CommonFileDialog.cs

示例12: OnFileOk

            public HResult OnFileOk(IFileDialog pfd)
            {
                CancelEventArgs args = new CancelEventArgs();
                parent.OnFileOk(args);

                if (!args.Cancel)
                {
                    // Make sure all custom properties are sync'ed
                    if (parent.Controls != null)
                    {
                        foreach (CommonFileDialogControl control in parent.Controls)
                        {
                            CommonFileDialogTextBox textBox;
                            CommonFileDialogGroupBox groupBox; ;

                            if ((textBox = control as CommonFileDialogTextBox) != null)
                            {
                                textBox.SyncValue();
                                textBox.Closed = true;
                            }
                            // Also check subcontrols
                            else if ((groupBox = control as CommonFileDialogGroupBox) != null)
                            {
                                foreach (CommonFileDialogControl subcontrol in groupBox.Items)
                                {
                                    CommonFileDialogTextBox textbox = subcontrol as CommonFileDialogTextBox;
                                    if (textbox != null)
                                    {
                                        textbox.SyncValue();
                                        textbox.Closed = true;
                                    }
                                }
                            }
                        }
                    }
                }

                return (args.Cancel ? HResult.False : HResult.Ok);
            }
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:39,代码来源:CommonFileDialog.cs

示例13: GetCustomizedFileDialog

 /// <summary>
 /// Get the IFileDialogCustomize interface, preparing to add controls.
 /// </summary>
 private void GetCustomizedFileDialog()
 {
     if (customize == null)
     {
         if (nativeDialog == null)
         {
             InitializeNativeFileDialog();
             nativeDialog = GetNativeFileDialog();
         }
         customize = (IFileDialogCustomize)nativeDialog;
     }
 }
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:15,代码来源:CommonFileDialog.cs

示例14: GetResult

 private void GetResult(IFileDialog dialog)
 {
     IShellItem item;
     dialog.GetResult(out item);
     item.GetDisplayName(NativeMethods.SIGDN.SIGDN_FILESYSPATH, out _selectedPath);
 }
开发者ID:divyang4481,项目名称:lextudio,代码行数:6,代码来源:clsFolderBrowserDialog.cs

示例15: IsOptionSet

        private bool IsOptionSet(IFileDialog dialog, NativeMethods.FOS flag)
        {
            NativeMethods.FOS currentFlags = GetCurrentOptionFlags(dialog);

            return (currentFlags & flag) == flag;
        }
开发者ID:ssickles,项目名称:archive,代码行数:6,代码来源:CommonFileDialog.cs


注:本文中的IFileDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。