Inheritance: UE4PropVis.UE4Visualizer
示例#1
0
		public override void GetChildItems(DkmEvaluationResultEnumContext enumContext, int start, int count, out DkmChildVisualizedExpression[] items)
		{
			// Cap the requested number to the total remaining from startIndex
			count = Math.Min(count, enumContext.Count - start);
			items = new DkmChildVisualizedExpression[count];
			uint idx = 0;

			// Retrieve the default expansion enum context
			var default_data = enumContext.GetDataItem<DefaultEnumContextDataItem>();

			if (start < default_data.Context.Count)
			{
				// Requesting default children

				int default_count = Math.Min(count, default_data.Context.Count - start);
				DkmEvaluationResult[] default_evals;
				expression_.GetItemsCallback(default_data.Context, start, default_count, out default_evals);
				for (int dft_idx = 0; dft_idx < default_count; ++dft_idx, ++idx)
				{
					DkmSuccessEvaluationResult success_eval = default_evals[dft_idx] as DkmSuccessEvaluationResult;
					DkmExpressionValueHome home = null;
					if (success_eval != null && success_eval.Address != null)
					{
						home = DkmPointerValueHome.Create(success_eval.Address.Value);
					}
					else
					{
						home = DkmFakeValueHome.Create(0);
					}

					items[idx] = DkmChildVisualizedExpression.Create(
						enumContext.InspectionContext,
						expression_.VisualizerId,	// @TODO: Check this is what we want. Will we get callbacks for it, regardless of its type?
						expression_.SourceId,
						enumContext.StackFrame,
						home,
						default_evals[dft_idx],
						expression_,
						(uint)start,
						null
						);
				}
			}

			if (start + count > default_data.Context.Count)
			{
				// Requesting custom children
				// @NOTE: Currently just assuming only 1 custom child (prop list) and hard coding as such.

				// DkmSuccessEvaluationResult.ExtractFromProperty(IDebugProperty3!!!!!!!) ...............................................

				// @NOTE: Had thought could just create an expression with a null evaluation
				// inside it, and by giving it a visualizer guid, the system would call back
				// to us to evaluate the expression. Seems not to work though, I guess because the
				// visualizer guid identifies the visualizer but not the containing component,
				// and since the expression itself doesn't have a type, it can't know that it 
				// should call our component.
				DkmEvaluationResult eval = DkmSuccessEvaluationResult.Create(
					enumContext.InspectionContext,
					enumContext.StackFrame,
					Resources.UE4PropVis.IDS_DISP_BLUEPRINTPROPERTIES,
					Resources.UE4PropVis.IDS_DISP_BLUEPRINTPROPERTIES,
					DkmEvaluationResultFlags.ReadOnly | DkmEvaluationResultFlags.Expandable,
					"",	// @TODO: something like "[<count> properties]"
					null,
					"",	// Type column
					DkmEvaluationResultCategory.Other,
					DkmEvaluationResultAccessType.None,
					DkmEvaluationResultStorageType.None,
					DkmEvaluationResultTypeModifierFlags.None,
					null,
					null,
					null,
					null
					);

				// This child is just for organization and does not correspond to anything in memory.
				DkmExpressionValueHome valueHome = DkmFakeValueHome.Create(0);

				var prop_list_expr = DkmChildVisualizedExpression.Create(
					enumContext.InspectionContext,
					Guids.Visualizer.PropertyList,
					// Associate the expression with ourselves, since we created it
					Guids.Component.VisualizerComponent,
					enumContext.StackFrame,
					valueHome,
					eval,
					expression_,
					idx,
					null
					);

				// Create a visualizer for the property list, and attach it to the expression.
				var prop_list_visualizer = new PropertyListVisualizer(prop_list_expr, access_ctx_);
				prop_list_expr.SetDataItem(DkmDataCreationDisposition.CreateAlways, new ExpressionDataItem(prop_list_visualizer));

				items[idx] = prop_list_expr;
            }
		}
示例#2
0
        public override void GetChildItems(DkmEvaluationResultEnumContext enumContext, int start, int count, out DkmChildVisualizedExpression[] items)
        {
            // Cap the requested number to the total remaining from startIndex
            count = Math.Min(count, enumContext.Count - start);
            items = new DkmChildVisualizedExpression[count];
            uint idx = 0;

            // Retrieve the default expansion enum context
            var default_data = enumContext.GetDataItem <DefaultEnumContextDataItem>();

            if (start < default_data.Context.Count)
            {
                // Requesting default children

                int default_count = Math.Min(count, default_data.Context.Count - start);
                DkmEvaluationResult[] default_evals;
                expression_.GetItemsCallback(default_data.Context, start, default_count, out default_evals);
                for (int dft_idx = 0; dft_idx < default_count; ++dft_idx, ++idx)
                {
                    DkmSuccessEvaluationResult success_eval = default_evals[dft_idx] as DkmSuccessEvaluationResult;
                    DkmExpressionValueHome     home         = null;
                    if (success_eval != null && success_eval.Address != null)
                    {
                        home = DkmPointerValueHome.Create(success_eval.Address.Value);
                    }
                    else
                    {
                        home = DkmFakeValueHome.Create(0);
                    }

                    items[idx] = DkmChildVisualizedExpression.Create(
                        enumContext.InspectionContext,
                        expression_.VisualizerId,                               // @TODO: Check this is what we want. Will we get callbacks for it, regardless of its type?
                        expression_.SourceId,
                        enumContext.StackFrame,
                        home,
                        default_evals[dft_idx],
                        expression_,
                        (uint)start,
                        null
                        );
                }
            }

            if (start + count > default_data.Context.Count)
            {
                // Requesting custom children
                // @NOTE: Currently just assuming only 1 custom child (prop list) and hard coding as such.

                // DkmSuccessEvaluationResult.ExtractFromProperty(IDebugProperty3!!!!!!!) ...............................................

                // @NOTE: Had thought could just create an expression with a null evaluation
                // inside it, and by giving it a visualizer guid, the system would call back
                // to us to evaluate the expression. Seems not to work though, I guess because the
                // visualizer guid identifies the visualizer but not the containing component,
                // and since the expression itself doesn't have a type, it can't know that it
                // should call our component.
                DkmEvaluationResult eval = DkmSuccessEvaluationResult.Create(
                    enumContext.InspectionContext,
                    enumContext.StackFrame,
                    Resources.UE4PropVis.IDS_DISP_BLUEPRINTPROPERTIES,
                    Resources.UE4PropVis.IDS_DISP_BLUEPRINTPROPERTIES,
                    DkmEvaluationResultFlags.ReadOnly | DkmEvaluationResultFlags.Expandable,
                    "",                         // @TODO: something like "[<count> properties]"
                    null,
                    "",                         // Type column
                    DkmEvaluationResultCategory.Other,
                    DkmEvaluationResultAccessType.None,
                    DkmEvaluationResultStorageType.None,
                    DkmEvaluationResultTypeModifierFlags.None,
                    null,
                    null,
                    null,
                    null
                    );

                // This child is just for organization and does not correspond to anything in memory.
                DkmExpressionValueHome valueHome = DkmFakeValueHome.Create(0);

                var prop_list_expr = DkmChildVisualizedExpression.Create(
                    enumContext.InspectionContext,
                    Guids.Visualizer.PropertyList,
                    // Associate the expression with ourselves, since we created it
                    Guids.Component.VisualizerComponent,
                    enumContext.StackFrame,
                    valueHome,
                    eval,
                    expression_,
                    idx,
                    null
                    );

                // Create a visualizer for the property list, and attach it to the expression.
                var prop_list_visualizer = new PropertyListVisualizer(prop_list_expr, access_ctx_);
                prop_list_expr.SetDataItem(DkmDataCreationDisposition.CreateAlways, new ExpressionDataItem(prop_list_visualizer));

                items[idx] = prop_list_expr;
            }
        }