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


C# IShellItem类代码示例

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


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


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