Added hammock project to debug streaming issues
[pithos-ms-client] / trunk / Pithos.ShellExtensions / Menus / FileContextMenu.cs
index 8c61f0d..7de2f6e 100644 (file)
@@ -178,11 +178,11 @@ namespace Pithos.ShellExtensions.Menus
             }
 
 
-            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;
@@ -210,7 +210,7 @@ namespace Pithos.ShellExtensions.Menus
                     // 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)
@@ -267,7 +267,7 @@ namespace Pithos.ShellExtensions.Menus
 
             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))
                 {
@@ -275,7 +275,7 @@ namespace Pithos.ShellExtensions.Menus
                     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);
             }
         }
 
@@ -312,19 +312,19 @@ namespace Pithos.ShellExtensions.Menus
             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);
             }
 
@@ -339,14 +339,14 @@ namespace Pithos.ShellExtensions.Menus
 
             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))
@@ -360,7 +360,7 @@ namespace Pithos.ShellExtensions.Menus
                 }
             }
 
-            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);
@@ -375,7 +375,7 @@ namespace Pithos.ShellExtensions.Menus
 
 
 
-            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).