• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IShellItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: PostNewItem

 public virtual void PostNewItem(uint dwFlags, 
     IShellItem psiDestinationFolder, string pszNewName,
     string pszTemplateName, uint dwFileAttributes, 
     uint hrNew, IShellItem psiNewItem)
 {
     TraceAction("PostNewItem", psiNewItem, hrNew);
 }
开发者ID:martin-holy,项目名称:PictureManager,代码行数:7,代码来源:FileOperationProgressSink.cs


示例2: 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


示例3: TraceAction

        private static void TraceAction(string action, IShellItem item, uint hresult)
        {

            //TraceAction(action, 
            //   item != null ?  Marshal.PtrToStringUni(item.GetDisplayName(WindowsAPI.SIGDN.NORMALDISPLAY)) : null, 
            //   hresult);
        }
开发者ID:Gainedge,项目名称:BetterExplorer,代码行数:7,代码来源:FileOperationProgressSink.cs


示例4: PostCopyItem

 public virtual void PostCopyItem(
     uint dwFlags, IShellItem psiItem,
     IShellItem psiDestinationFolder, string pszNewName,
     uint hrCopy, IShellItem psiNewlyCreated)
 {
     TraceAction("PostCopyItem", psiNewlyCreated, hrCopy);
 }
开发者ID:rad1oactive,项目名称:BetterExplorer,代码行数:7,代码来源:FileOperationProgressSink.cs


示例5: PostMoveItem

 public void PostMoveItem(
     uint dwFlags, IShellItem psiItem, 
     IShellItem psiDestinationFolder,
     string pszNewName, uint hrMove, 
     IShellItem psiNewlyCreated)
 {
     TraceAction("PostMoveItem", psiNewlyCreated, hrMove);
 }
开发者ID:iraychen,项目名称:ZetaLongPaths,代码行数:8,代码来源:FileOperationProgressSink.cs


示例6: GetShellItemFromFolder

 private static IShellItem GetShellItemFromFolder(IShellItem shellItem, IShellFolder shellFolder)
 {
     if (shellItem == null && shellFolder == null)
         throw new ArgumentNullException("shellItem, shellFolder", "shellItem and shellFolder cannot both be null");
     if (shellItem != null)
         return shellItem;
     IdList pidl = SHGetIDListFromObject(shellFolder);
     return SHCreateItemFromIDList<IShellItem>(pidl);
 }
开发者ID:poizan42,项目名称:PSShellProvider,代码行数:9,代码来源:ShellFolder.cs


示例7: ShellFolder

 internal ShellFolder(IShellItem shellItem, IShellFolder shellFolder, ShellItemKnownInfo knownInfo)
     : base(GetShellItemFromFolder(shellItem, shellFolder), knownInfo)
 {
     if (shellFolder == null)
     {
         shellFolder = (IShellFolder)shellItem.BindToHandler(null, ShellConsts.BHID_SFObject, typeof(IShellFolder).GUID);
     }
     NativeFolder = shellFolder;
 }
开发者ID:poizan42,项目名称:PSShellProvider,代码行数:9,代码来源:ShellFolder.cs


示例8: PidlFromShellItem

        internal static IntPtr PidlFromShellItem(IShellItem nativeShellItem)
        {
            IntPtr shellItem = Marshal.GetComInterfaceForObject(nativeShellItem, typeof(IShellItem));
            IntPtr pidl;

            int retCode = ShellNativeMethods.SHGetIDListFromObject(shellItem, out pidl);

            return (CoreErrorHelper.Succeeded(retCode) ? pidl : IntPtr.Zero);
        }
开发者ID:TanyaTPG,项目名称:Log2Console,代码行数:9,代码来源:ShellHelper.cs


示例9: GetItemAt

		public HResult GetItemAt(uint dwIndex, out IShellItem ppsi) {
			int index = (int)dwIndex;

			if (index < shellItemsList.Count) {
				ppsi = shellItemsList[index];
				return HResult.Ok;
			} else {
				ppsi = null;
				return HResult.Fail;
			}
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:11,代码来源:ShellItemArray.cs


示例10: GetParent

		public HResult GetParent(out IShellItem ppsi) {
			IntPtr pidl = Shell32.ILClone(Pidl);
			if (Shell32.ILRemoveLastID(pidl)) {
				ppsi = new ShellItemImpl(pidl, true);
				return HResult.S_OK;
			}
			else {
				ppsi = null;
				return HResult.MK_E_NOOBJECT;
			}
		}
开发者ID:Gainedge,项目名称:BetterExplorer,代码行数:11,代码来源:ShellItemImpl.cs


示例11: GetItemAt

        public HRESULT GetItemAt(uint dwIndex, out IShellItem ppsi)
        {
            int index = (int)dwIndex;

            if (index < shellItemsList.Count)
            {
                ppsi = shellItemsList[index];
                return HRESULT.S_OK;
            }
            else
            {
                ppsi = null;
                return HRESULT.E_FAIL;
            }
        }
开发者ID:pmorton,项目名称:Log2Console,代码行数:15,代码来源:ShellItemArray.cs


示例12:

		void IShellItemArray.GetItemAt(uint dwIndex, out IShellItem ppsi)
		{
			int index = (int)dwIndex;

			if (index < shellItemsList.Count)
			{
				ppsi = shellItemsList[index];
				//return HResult.S_OK;
			}
			else
			{
				ppsi = null;
				//return HResult.S_FALSE;
			}
		}
开发者ID:Gainedge,项目名称:BetterExplorer,代码行数:15,代码来源:ShellItemArray.cs


示例13: PostDeleteItem

		public override void PostDeleteItem(TRANSFER_SOURCE_FLAGS dwFlags, IShellItem psiItem, uint hrDelete, IShellItem psiNewlyCreated) {
			//base.PostDeleteItem(dwFlags,psiItem,hrDelete,psiNewlyCreated);
			//if (hrDelete == 2555912) {
			//	var theNewItem = FileSystemListItem.InitializeWithIShellItem(this._View.LVHandle, psiItem);
			//  if (this._View.CurrentFolder.Equals(theNewItem.Parent)) {
			//    Shell32.SHChangeNotify(
			//      theNewItem.IsFolder ? Shell32.HChangeNotifyEventID.SHCNE_RMDIR : Shell32.HChangeNotifyEventID.SHCNE_DELETE,
			//      Shell32.HChangeNotifyFlags.SHCNF_IDLIST | Shell32.HChangeNotifyFlags.SHCNF_FLUSH, theNewItem.PIDL, IntPtr.Zero);
			//  }
			//  theNewItem.Dispose();
			//}
			//if (psiItem != null) {
			//  Marshal.FinalReleaseComObject(psiItem);
			//}

			//  if (psiNewlyCreated != null) {
			//    Marshal.FinalReleaseComObject(psiNewlyCreated);
			//  }
			//Shell32.SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1);
		}
开发者ID:Gainedge,项目名称:BetterExplorer,代码行数:20,代码来源:FOperationProgressSink.cs


示例14: 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


示例15: PostCopyItem

		public override void PostCopyItem(TRANSFER_SOURCE_FLAGS dwFlags, IShellItem psiItem, IShellItem psiDestinationFolder, string pszNewName, uint hrCopy, IShellItem psiNewlyCreated) {
			//if (hrCopy == 0) {
			//     var destination = FileSystemListItem.InitializeWithIShellItem(this._View.LVHandle, psiDestinationFolder);
			//  if (destination.Equals(this._View.CurrentFolder)) {
			//    var theNewItem = FileSystemListItem.InitializeWithIShellItem(this._View.LVHandle, psiNewlyCreated);
			//    Shell32.SHChangeNotify(
			//      theNewItem.IsFolder ? Shell32.HChangeNotifyEventID.SHCNE_MKDIR : Shell32.HChangeNotifyEventID.SHCNE_CREATE,
			//      Shell32.HChangeNotifyFlags.SHCNF_IDLIST | Shell32.HChangeNotifyFlags.SHCNF_FLUSH, theNewItem.PIDL, IntPtr.Zero);
			//    this._View.LargeImageList.SupressThumbnailGeneration(false);
			//    Shell32.SHChangeNotify(Shell32.HChangeNotifyEventID.SHCNE_UPDATEITEM,
			//      Shell32.HChangeNotifyFlags.SHCNF_IDLIST | Shell32.HChangeNotifyFlags.SHCNF_FLUSH, theNewItem.PIDL, IntPtr.Zero);
			//    theNewItem.Dispose();
			//  }
			//     destination.Dispose();
			//}
			//if (psiItem != null) {
			//  Marshal.FinalReleaseComObject(psiItem);
			//}

			//if (psiNewlyCreated != null) {
			//  Marshal.FinalReleaseComObject(psiNewlyCreated);
			//}
			//Shell32.SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1);
		}
开发者ID:Gainedge,项目名称:BetterExplorer,代码行数:24,代码来源:FOperationProgressSink.cs


示例16: OnOverwrite

 public void OnOverwrite(IFileDialog pfd, IShellItem psi, out NativeMethods.RESPONSE pResponse)
 {
     pResponse = NativeMethods.RESPONSE.ACCEPT;
 }
开发者ID:MotorViper,项目名称:FormGenerator,代码行数:4,代码来源:WPFFolderBrowserDialog.cs


示例17: OnShareViolation

 public void OnShareViolation(IFileDialog pfd, IShellItem psi, out NativeMethods.RESPONSE pResponse)
 {
     // Do nothing: we will ignore share violations, and don't register
     // for them, so this method should never be called
     pResponse = NativeMethods.RESPONSE.ACCEPT;
 }
开发者ID:MotorViper,项目名称:FormGenerator,代码行数:6,代码来源:WPFFolderBrowserDialog.cs


示例18: OnFolderChanging

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


示例19: GetFileNameFromShellItem

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


示例20: GetPathFromShellItem

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IShellLinkW类代码示例发布时间:2022-05-24
下一篇:
C# IShellFolder类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap