コード例 #1
0
        public EvaluationDataItem(DkmVisualizedExpression expression, DkmEvaluationResult evalResult)
        {
            expression_ = expression;
            evalResult_ = evalResult;

            VisualizerRegistrar.TryCreateVisualizer(expression, out visualizer_);
        }
コード例 #2
0
        private bool TryGetRegisteredVisualizer(DkmVisualizedExpression expression, out BasicVisualizer visualizer, out DkmFailedEvaluationResult failureResult)
        {
            visualizer    = null;
            failureResult = null;

            if (VisualizerRegistrar.TryCreateVisualizer(expression, out visualizer))
            {
                return(true);
            }

            string name     = null;
            string fullName = null;

            Utility.GetExpressionName(expression, out name, out fullName);

            DkmFailedEvaluationResult failure = DkmFailedEvaluationResult.Create(
                expression.InspectionContext,
                expression.StackFrame,
                name,
                fullName,
                String.Format("No formatter is registered for VisualizerId {0}",
                              expression.VisualizerId),
                DkmEvaluationResultFlags.Invalid,
                null);

            failureResult = failure;
            return(false);
        }
コード例 #3
0
        void IDkmCustomVisualizer.UseDefaultEvaluationBehavior(DkmVisualizedExpression expression, out bool useDefaultEvaluationBehavior, out DkmEvaluationResult defaultEvaluationResult)
        {
            BasicVisualizer visualizer = null;

            defaultEvaluationResult      = null;
            useDefaultEvaluationBehavior = true;
            if (expression.VisualizerId != Guids.CustomVisualizer.ForceDefault &&
                VisualizerRegistrar.TryCreateVisualizer(expression, out visualizer))
            {
                // If this visualizer has custom fields, or displays default fields non-inline, don't use
                // the default evaluation behavior.
                ChildDisplayFlags flags = visualizer.ChildDisplayFlags;
                if (flags.HasFlag(ChildDisplayFlags.HasCustomFields) ||
                    !flags.HasFlag(ChildDisplayFlags.DefaultFieldsInline))
                {
                    useDefaultEvaluationBehavior = false;
                }
            }

            if (useDefaultEvaluationBehavior)
            {
                string name     = null;
                string fullName = null;
                Utility.GetExpressionName(expression, out name, out fullName);
                fullName += ",!";
                defaultEvaluationResult = CppExpressionEvaluator.Evaluate(expression, fullName);
            }
        }
コード例 #4
0
 static IdeComponent()
 {
     VisualizerRegistrar.Register <DateTimeVisualizer.Factory>(Guids.CustomVisualizer.BaseTime);
     VisualizerRegistrar.Register <TimeDeltaVisualizer.Factory>(Guids.CustomVisualizer.BaseTimeDelta);
 }