本文整理汇总了C#中ICorDebugThread.GetAppDomain方法的典型用法代码示例。如果您正苦于以下问题:C# ICorDebugThread.GetAppDomain方法的具体用法?C# ICorDebugThread.GetAppDomain怎么用?C# ICorDebugThread.GetAppDomain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICorDebugThread
的用法示例。
在下文中一共展示了ICorDebugThread.GetAppDomain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeCurrentDebuggerState
void InitializeCurrentDebuggerState(DebugCallbackEventArgs e, ICorDebugProcess comProcess, ICorDebugAppDomain comAppDomain, ICorDebugThread comThread)
{
if (comThread != null) {
if (comProcess == null)
comThread.GetProcess(out comProcess);
if (comAppDomain == null)
comThread.GetAppDomain(out comAppDomain);
}
if (comAppDomain != null) {
if (comProcess == null)
comAppDomain.GetProcess(out comProcess);
}
var process = TryGetValidProcess(comProcess);
DnAppDomain appDomain;
DnThread thread;
if (process != null) {
appDomain = process.TryGetAppDomain(comAppDomain);
thread = process.TryGetThread(comThread);
}
else {
appDomain = null;
thread = null;
}
if (thread == null && appDomain == null && process != null)
appDomain = process.AppDomains.FirstOrDefault();
if (thread == null) {
if (appDomain != null)
thread = appDomain.Threads.FirstOrDefault();
else if (process != null)
thread = process.Threads.FirstOrDefault();
}
if (process == null)
SetDefaultCurrentProcess(e);
else
AddDebuggerState(new DebuggerState(e, process, appDomain, thread));
}
示例2: GetAppDomain
static ICorDebugAppDomain GetAppDomain(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread) {
if (pAppDomain == null && pThread != null)
pThread.GetAppDomain(out pAppDomain);
Debug.WriteLineIf(pAppDomain == null, "GetAppDomain: Could not get AppDomain");
return pAppDomain;
}