コード例 #1
0
ファイル: MethodInspector.cs プロジェクト: asiamina/TestLocal
        public Dictionary <string, EnvDTE.Expression> GetLocalVariables()
        {
            Dictionary <string, EnvDTE.Expression> debugVariables = new Dictionary <string, Expression>(StringComparer.CurrentCultureIgnoreCase);
            DTE dte = m_textSelection.DTE;

            if (dte.Debugger.CurrentStackFrame != null)
            {
                EnvDTE.Expressions locals = dte.Debugger.CurrentStackFrame.Locals;
                foreach (EnvDTE.Expression local in locals)
                {
                    string name = local.Name;
                    debugVariables[name] = local;
                }
            }
            return(debugVariables);
        }
コード例 #2
0
        public static List <string> GetMembersName(string expression)
        {
            string key = nameof(GetMembersName) + expression;

            if (DebuggerHelper.KnownValues.ContainsKey(key))
            {
                return((List <string>)DebuggerHelper.KnownValues[key]);
            }
            DebuggerHelper.KnownValues.Add(key, (object)null);
            EnvDTE.Expressions dataMembers = DebuggerHelper.Debugger.GetExpression(expression, false, -1).DataMembers;
            List <string>      stringList  = new List <string>();

            foreach (Expression expression1 in dataMembers)
            {
                stringList.Add(expression1[]);
            }
            DebuggerHelper.KnownValues[key] = (object)stringList;
            return(stringList);
        }
コード例 #3
0
ファイル: MainModel.cs プロジェクト: asiamina/TestLocal
        public EnvDTE.Expression GetDebugVariable(string varName)
        {
            DTE dte = this.DTE;

            debugger   = dte.Debugger;
            stackFrame = debugger.CurrentStackFrame;
            if (stackFrame != null)
            {
                locals = stackFrame.Locals;
                foreach (EnvDTE.Expression local in locals)
                {
                    string name = local.Name;
                    if (name == varName)
                    {
                        return(local);
                    }
                }
            }
            return(null);
        }