Revision 0eea575a trunk/Pithos.ShellExtensions/Menus/FileContextMenu.cs
b/trunk/Pithos.ShellExtensions/Menus/FileContextMenu.cs | ||
---|---|---|
178 | 178 |
} |
179 | 179 |
|
180 | 180 |
|
181 |
Trace.Write("Initializing");
|
|
181 |
Debug.WriteLine("Initializing", LogCategories.ShellMenu);
|
|
182 | 182 |
|
183 | 183 |
if (pDataObj != IntPtr.Zero) |
184 | 184 |
{ |
185 |
Trace.Write("Got a data object");
|
|
185 |
Debug.WriteLine("Got a data object", LogCategories.ShellMenu);
|
|
186 | 186 |
|
187 | 187 |
FORMATETC fe = new FORMATETC(); |
188 | 188 |
fe.cfFormat = (short)CLIPFORMAT.CF_HDROP; |
... | ... | |
210 | 210 |
// Determine how many files are involved in this operation. |
211 | 211 |
uint nFiles = NativeMethods.DragQueryFile(hDrop, UInt32.MaxValue, null, 0); |
212 | 212 |
|
213 |
Trace.Write(String.Format("Got {0} files", nFiles));
|
|
213 |
Debug.WriteLine(String.Format("Got {0} files", nFiles), LogCategories.ShellMenu);
|
|
214 | 214 |
// This code sample displays the custom context menu item when only |
215 | 215 |
// one file is selected. |
216 | 216 |
if (nFiles == 1) |
... | ... | |
267 | 267 |
|
268 | 268 |
if (pidlFolder != IntPtr.Zero) |
269 | 269 |
{ |
270 |
Trace.Write("Got a folder");
|
|
270 |
Debug.WriteLine("Got a folder", LogCategories.ShellMenu);
|
|
271 | 271 |
StringBuilder path = new StringBuilder(); |
272 | 272 |
if (!NativeMethods.SHGetPathFromIDList(pidlFolder, path)) |
273 | 273 |
{ |
... | ... | |
275 | 275 |
Marshal.ThrowExceptionForHR(error); |
276 | 276 |
} |
277 | 277 |
Context.CurrentFolder = path.ToString(); |
278 |
Trace.Write(String.Format("Folder is {0}", Context.CurrentFolder));
|
|
278 |
Debug.WriteLine(String.Format("Folder is {0}", Context.CurrentFolder), LogCategories.ShellMenu);
|
|
279 | 279 |
} |
280 | 280 |
} |
281 | 281 |
|
... | ... | |
312 | 312 |
uint idCmdLast, |
313 | 313 |
uint uFlags) |
314 | 314 |
{ |
315 |
Trace.Write("Start qcm");
|
|
315 |
Debug.WriteLine("Start qcm", LogCategories.ShellMenu);
|
|
316 | 316 |
// If uFlags include CMF_DEFAULTONLY then we should not do anything. |
317 |
Trace.Write(String.Format("Flags {0}", uFlags));
|
|
317 |
Debug.WriteLine(String.Format("Flags {0}", uFlags), LogCategories.ShellMenu);
|
|
318 | 318 |
|
319 | 319 |
if (((uint)CMF.CMF_DEFAULTONLY & uFlags) != 0) |
320 | 320 |
{ |
321 |
Trace.Write("Default only flag, returning");
|
|
321 |
Debug.WriteLine("Default only flag, returning", LogCategories.ShellMenu);
|
|
322 | 322 |
return WinError.MAKE_HRESULT(WinError.SEVERITY_SUCCESS, 0, 0); |
323 | 323 |
} |
324 | 324 |
|
325 | 325 |
if (!Context.IsManaged) |
326 | 326 |
{ |
327 |
Trace.Write("Not a PITHOS folder");
|
|
327 |
Debug.WriteLine("Not a PITHOS folder",LogCategories.ShellMenu);
|
|
328 | 328 |
return WinError.MAKE_HRESULT(WinError.SEVERITY_SUCCESS, 0, 0); |
329 | 329 |
} |
330 | 330 |
|
... | ... | |
339 | 339 |
|
340 | 340 |
DisplayFlags itemType = (Context.IsFolder) ? DisplayFlags.Folder : DisplayFlags.File; |
341 | 341 |
|
342 |
Trace.Write(String.Format("Item Flags {0}", itemType));
|
|
342 |
Debug.WriteLine(String.Format("Item Flags {0}", itemType), LogCategories.ShellMenu);
|
|
343 | 343 |
|
344 | 344 |
foreach (var menuItem in _items.Values) |
345 | 345 |
{ |
346 |
Trace.Write(String.Format("Menu Flags {0}", menuItem.DisplayFlags));
|
|
346 |
Debug.WriteLine(String.Format("Menu Flags {0}", menuItem.DisplayFlags), LogCategories.ShellMenu);
|
|
347 | 347 |
if ((itemType & menuItem.DisplayFlags) != DisplayFlags.None) |
348 | 348 |
{ |
349 |
Trace.Write("Adding Menu");
|
|
349 |
Debug.WriteLine("Adding Menu", LogCategories.ShellMenu);
|
|
350 | 350 |
|
351 | 351 |
MENUITEMINFO mii = menuItem.CreateInfo(idCmdFirst); |
352 | 352 |
if (!NativeMethods.InsertMenuItem(hMenu, iMenu, true, ref mii)) |
... | ... | |
360 | 360 |
} |
361 | 361 |
} |
362 | 362 |
|
363 |
Trace.Write("Adding Separator 1");
|
|
363 |
Debug.Write("Adding Separator 1", LogCategories.ShellMenu);
|
|
364 | 364 |
// Add a separator. |
365 | 365 |
MENUITEMINFO sep = new MENUITEMINFO(); |
366 | 366 |
sep.cbSize = (uint)Marshal.SizeOf(sep); |
... | ... | |
375 | 375 |
|
376 | 376 |
|
377 | 377 |
|
378 |
Trace.Write("Menus added");
|
|
378 |
Debug.WriteLine("Menus added", LogCategories.ShellOverlays);
|
|
379 | 379 |
// Return an HRESULT value with the severity set to SEVERITY_SUCCESS. |
380 | 380 |
// Set the code value to the offset of the largest command identifier |
381 | 381 |
// that was assigned, plus one (1). |
Also available in: Unified diff