}
- Trace.Write("Initializing");
+ Debug.WriteLine("Initializing", LogCategories.ShellMenu);
if (pDataObj != IntPtr.Zero)
{
- Trace.Write("Got a data object");
+ Debug.WriteLine("Got a data object", LogCategories.ShellMenu);
FORMATETC fe = new FORMATETC();
fe.cfFormat = (short)CLIPFORMAT.CF_HDROP;
// Determine how many files are involved in this operation.
uint nFiles = NativeMethods.DragQueryFile(hDrop, UInt32.MaxValue, null, 0);
- Trace.Write(String.Format("Got {0} files", nFiles));
+ Debug.WriteLine(String.Format("Got {0} files", nFiles), LogCategories.ShellMenu);
// This code sample displays the custom context menu item when only
// one file is selected.
if (nFiles == 1)
if (pidlFolder != IntPtr.Zero)
{
- Trace.Write("Got a folder");
+ Debug.WriteLine("Got a folder", LogCategories.ShellMenu);
StringBuilder path = new StringBuilder();
if (!NativeMethods.SHGetPathFromIDList(pidlFolder, path))
{
Marshal.ThrowExceptionForHR(error);
}
Context.CurrentFolder = path.ToString();
- Trace.Write(String.Format("Folder is {0}", Context.CurrentFolder));
+ Debug.WriteLine(String.Format("Folder is {0}", Context.CurrentFolder), LogCategories.ShellMenu);
}
}
uint idCmdLast,
uint uFlags)
{
- Trace.Write("Start qcm");
+ Debug.WriteLine("Start qcm", LogCategories.ShellMenu);
// If uFlags include CMF_DEFAULTONLY then we should not do anything.
- Trace.Write(String.Format("Flags {0}", uFlags));
+ Debug.WriteLine(String.Format("Flags {0}", uFlags), LogCategories.ShellMenu);
if (((uint)CMF.CMF_DEFAULTONLY & uFlags) != 0)
{
- Trace.Write("Default only flag, returning");
+ Debug.WriteLine("Default only flag, returning", LogCategories.ShellMenu);
return WinError.MAKE_HRESULT(WinError.SEVERITY_SUCCESS, 0, 0);
}
if (!Context.IsManaged)
{
- Trace.Write("Not a PITHOS folder");
+ Debug.WriteLine("Not a PITHOS folder",LogCategories.ShellMenu);
return WinError.MAKE_HRESULT(WinError.SEVERITY_SUCCESS, 0, 0);
}
DisplayFlags itemType = (Context.IsFolder) ? DisplayFlags.Folder : DisplayFlags.File;
- Trace.Write(String.Format("Item Flags {0}", itemType));
+ Debug.WriteLine(String.Format("Item Flags {0}", itemType), LogCategories.ShellMenu);
foreach (var menuItem in _items.Values)
{
- Trace.Write(String.Format("Menu Flags {0}", menuItem.DisplayFlags));
+ Debug.WriteLine(String.Format("Menu Flags {0}", menuItem.DisplayFlags), LogCategories.ShellMenu);
if ((itemType & menuItem.DisplayFlags) != DisplayFlags.None)
{
- Trace.Write("Adding Menu");
+ Debug.WriteLine("Adding Menu", LogCategories.ShellMenu);
MENUITEMINFO mii = menuItem.CreateInfo(idCmdFirst);
if (!NativeMethods.InsertMenuItem(hMenu, iMenu, true, ref mii))
}
}
- Trace.Write("Adding Separator 1");
+ Debug.Write("Adding Separator 1", LogCategories.ShellMenu);
// Add a separator.
MENUITEMINFO sep = new MENUITEMINFO();
sep.cbSize = (uint)Marshal.SizeOf(sep);
- Trace.Write("Menus added");
+ Debug.WriteLine("Menus added", LogCategories.ShellOverlays);
// Return an HRESULT value with the severity set to SEVERITY_SUCCESS.
// Set the code value to the offset of the largest command identifier
// that was assigned, plus one (1).