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


C# IShellItem.GetDisplayName方法代码示例

本文整理汇总了C#中IShellItem.GetDisplayName方法的典型用法代码示例。如果您正苦于以下问题:C# IShellItem.GetDisplayName方法的具体用法?C# IShellItem.GetDisplayName怎么用?C# IShellItem.GetDisplayName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IShellItem的用法示例。


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

示例1: GetParsingName

        private static string GetParsingName(IShellItem shellItem)
        {
            if (shellItem == null)
                return null;

            string path = null;

            IntPtr pszPath = IntPtr.Zero;
            int hr = shellItem.GetDisplayName(Shell32.SIGDN.SIGDN_DESKTOPABSOLUTEPARSING, out pszPath);

            if (false ==
                    (hr == HRESULT.S_OK ||
                     hr == HRESULT.E_INVALIDARG))
                throw new COMException("GetParsingName", (int)hr);

            if (pszPath != IntPtr.Zero)
            {
                path = Marshal.PtrToStringAuto(pszPath);
                Marshal.FreeCoTaskMem(pszPath);
                pszPath = IntPtr.Zero;
            }

            return path;

        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:25,代码来源:JumpListItem.cs

示例2: GetParsingName

		internal static string GetParsingName(IShellItem shellItem) {
			if (shellItem == null) { return null; }

			string path = null;

			IntPtr pszPath = IntPtr.Zero;
			HResult hr = shellItem.GetDisplayName(ShellNativeMethods.ShellItemDesignNameOptions.DesktopAbsoluteParsing, out pszPath);

			if (hr != HResult.Ok && hr != HResult.InvalidArguments) {
				throw new ShellException(LocalizedMessages.ShellHelperGetParsingNameFailed, hr);
			}

			if (pszPath != IntPtr.Zero) {
				path = Marshal.PtrToStringAuto(pszPath);
				Marshal.FreeCoTaskMem(pszPath);
				pszPath = IntPtr.Zero;
			}

			return path;

		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:21,代码来源:ShellHelper.cs

示例3: GetFileNameFromShellItem

 internal string GetFileNameFromShellItem(IShellItem item)
 {
     string filename;
     item.GetDisplayName(NativeMethods.SIGDN.DESKTOPABSOLUTEPARSING, out filename);
     return filename;
 }
开发者ID:MotorViper,项目名称:FormGenerator,代码行数:6,代码来源:WPFFolderBrowserDialog.cs

示例4: GetPathFromShellItem

 public static string GetPathFromShellItem(IShellItem item)
 {
     return item.GetDisplayName(SIGDN.DESKTOPABSOLUTEPARSING);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:ShellProvider.cs

示例5: TraceAction

 private static void TraceAction(
     string action, IShellItem item, uint hresult)
 {
     TraceAction(action, 
         item != null ? item.GetDisplayName(SIGDN.SIGDN_NORMALDISPLAY) : null, 
         hresult);
 }
开发者ID:martin-holy,项目名称:PictureManager,代码行数:7,代码来源:FileOperationProgressSink.cs

示例6: GetFileNameFromShellItem

 internal static string GetFileNameFromShellItem(IShellItem item)
 {
     string filename = null;
     IntPtr pszString = IntPtr.Zero;
     HResult hr = item.GetDisplayName(ShellNativeMethods.ShellItemDesignNameOptions.DesktopAbsoluteParsing, out pszString);
     if (hr == HResult.Ok && pszString != IntPtr.Zero)
     {
         filename = Marshal.PtrToStringAuto(pszString);
         Marshal.FreeCoTaskMem(pszString);
     }
     return filename;
 }
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:12,代码来源:CommonFileDialog.cs

示例7: RemoveCustomCategoryItem

        private string RemoveCustomCategoryItem(IShellItem item)
        {
            string path = null;

            if (customCategoriesCollection != null)
            {
                IntPtr pszString = IntPtr.Zero;
                HRESULT hr = item.GetDisplayName(ShellNativeMethods.SIGDN.SIGDN_FILESYSPATH, out pszString);
                if (hr == HRESULT.S_OK && pszString != IntPtr.Zero)
                {
                    path = Marshal.PtrToStringAuto(pszString);
                    // Free the string
                    Marshal.FreeCoTaskMem(pszString);
                }

                // Remove this item from each category
                foreach (JumpListCustomCategory category in customCategoriesCollection)
                    category.RemoveJumpListItem(path);

            }

            return path;
        }
开发者ID:NeilHanlon,项目名称:GVNotifierWPF,代码行数:23,代码来源:JumpList.cs

示例8: GetFileNameFromShellItem

 internal static string GetFileNameFromShellItem( IShellItem item )
 {
     string filename = null;
     IntPtr pszString = IntPtr.Zero;
     HRESULT hr = item.GetDisplayName( ShellNativeMethods.SIGDN.SIGDN_DESKTOPABSOLUTEPARSING, out pszString );
     if (hr == HRESULT.S_OK && pszString != IntPtr.Zero)
     {
         filename = Marshal.PtrToStringAuto(pszString);
         Marshal.FreeCoTaskMem(pszString);
     }
     return filename;
 }
开发者ID:overeemm,项目名称:JoomlaPodcaster,代码行数:12,代码来源:CommonFileDialog.cs

示例9: RemoveCustomCategoryItem

        private string RemoveCustomCategoryItem(IShellItem item)
        {
            string path = null;

            if (customCategoriesCollection != null)
            {
                IntPtr pszString = IntPtr.Zero;
                HResult hr = item.GetDisplayName(ShellNativeMethods.ShellItemDesignNameOptions.FileSystemPath, out pszString);
                if (hr == HResult.Ok && pszString != IntPtr.Zero)
                {
                    path = Marshal.PtrToStringAuto(pszString);
                    // Free the string
                    Marshal.FreeCoTaskMem(pszString);
                }

                // Remove this item from each category
                foreach (JumpListCustomCategory category in customCategoriesCollection)
                {
                    category.RemoveJumpListItem(path);
                }

            }

            return path;
        }
开发者ID:dlech,项目名称:SshAgentLib,代码行数:25,代码来源:JumpList.cs

示例10: PostCopyItem

 public override void PostCopyItem(uint dwFlags, IShellItem psiItem, IShellItem psiDestinationFolder, string pszNewName, uint hrCopy, IShellItem psiNewlyCreated) {
   if ((CopyEngineResult)hrCopy != CopyEngineResult.COPYENGINE_OK && (CopyEngineResult)hrCopy != CopyEngineResult.COPYENGINE_S_DONT_PROCESS_CHILDREN) return;
   ((Dictionary<string, string>)Application.Current.Properties[nameof(AppProps.FileOperationResult)]).Add(
     psiItem.GetDisplayName(SIGDN.SIGDN_FILESYSPATH), 
     psiNewlyCreated.GetDisplayName(SIGDN.SIGDN_FILESYSPATH));
 }
开发者ID:martin-holy,项目名称:PictureManager,代码行数:6,代码来源:PicFileOperationProgressSink.cs.cs

示例11: GetFilePathFromShellItem

		internal static string GetFilePathFromShellItem(IShellItem item)
		{
			string str;
			unchecked
			{
				item.GetDisplayName((SIGDN)(-2147319808), out str);
			}
			return str;
		}
开发者ID:Kuzq,项目名称:gitter,代码行数:9,代码来源:VistaPickFolderDialog.cs


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