本文整理汇总了C#中QTTabBarLib.IDLWrapper.IsDeadLink方法的典型用法代码示例。如果您正苦于以下问题:C# IDLWrapper.IsDeadLink方法的具体用法?C# IDLWrapper.IsDeadLink怎么用?C# IDLWrapper.IsDeadLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTTabBarLib.IDLWrapper
的用法示例。
在下文中一共展示了IDLWrapper.IsDeadLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: subDirTip_MenuItemClicked
private void subDirTip_MenuItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
// this can run in both desktop and taskbar thread
IntPtr hwndDialogParent = sender == subDirTip ? hwndListView : hwndShellTray;
// desktop thread or taskbar thread
QMenuItem qmi = (QMenuItem)e.ClickedItem;
if(qmi.Genre == MenuGenre.SubDirTip_QTGRootItem) {
Thread thread = new Thread(OpenGroup);
thread.SetApartmentState(ApartmentState.STA);
thread.IsBackground = true;
thread.Start(new object[] {new string[] {qmi.Name}, ModifierKeys});
}
else if(qmi.Target == MenuTarget.Folder) {
using(IDLWrapper idlw = new IDLWrapper(qmi.IDL)) {
if(!idlw.IsDeadLink(hwndDialogParent)) {
Keys modKey = ModifierKeys;
if(!Config.Bool(Scts.ActivateNewTab)) {
if(modKey == Keys.Shift) {
modKey = Keys.None;
}
else if(modKey == Keys.None) {
modKey = Keys.Shift;
}
}
if(idlw.IsLink) {
if(!String.IsNullOrEmpty(qmi.TargetPath) &&
qmi.TargetPath.StartsWith(IDLWrapper.INDICATOR_NETWORK) &&
-1 == qmi.TargetPath.IndexOf(@"\", 2) &&
!ShellMethods.IsIDLNullOrEmpty(qmi.IDLTarget)) {
// link target is network server root ( "\\server" ), prevent opening window
OpenTab(new object[] {null, modKey, qmi.IDLTarget});
return;
}
}
OpenTab(new object[] {null, modKey, idlw.IDL});
}
}
}
else {
using(IDLWrapper idlw = new IDLWrapper(qmi.IDL)) {
if(!idlw.IsDeadLink(hwndDialogParent)) {
string work = String.Empty;
SHELLEXECUTEINFO sei = new SHELLEXECUTEINFO();
sei.cbSize = Marshal.SizeOf(sei);
sei.nShow = SHOWWINDOW.SHOWNORMAL;
sei.fMask = SEEMASK.IDLIST;
sei.lpIDList = idlw.PIDL;
sei.hwnd = hwndDialogParent;
if(!String.IsNullOrEmpty(qmi.Path)) {
work = QTUtility2.MakeDefaultWorkingDirecotryStr(qmi.Path);
if(work.Length > 0) {
sei.lpDirectory = Marshal.StringToCoTaskMemUni(work);
}
}
try {
if(PInvoke.ShellExecuteEx(ref sei)) {
QTUtility.AddRecentFiles(
new string[][] {
work.Length > 0
? new string[] {qmi.Path, String.Empty, work}
: new string[] {qmi.Path}
}, hwndThis);
}
}
finally {
if(sei.lpDirectory != IntPtr.Zero) {
Marshal.FreeCoTaskMem(sei.lpDirectory);
}
}
}
}
}
}