예제 #1
0
        internal ReflectTransformBlock(TransformBlock <TIn, TOut> block, IBlockInitializer propertySetter)
            : base(block, propertySetter)
        {
            if (block == null)
            {
                return;
            }

            #region targetCoreField

            FieldInfo  targetCoreField = block.GetType().GetField("m_target", ReflectBlockExtensions.DEFAULT_FLAGS);
            object     targetCore      = targetCoreField.GetValue(block);
            MethodInfo getTargetDebuggingInformationMethod =
                targetCore.GetType().GetMethod("GetDebuggingInformation", ReflectBlockExtensions.DEFAULT_FLAGS);
            _targetDebugInfo = getTargetDebuggingInformationMethod.Invoke(targetCore, new object[0]);

            #endregion // targetCoreField

            //propertySetter.AddProperty("Input Count", () => block.InputCount, 3, Colors.White);
            //propertySetter.AddProperty("Output Count", () => block.OutputCount, 4, Colors.White);

            propertySetter.SetInputQueueFactory(() => ReflectBlockExtensions.GetInputQueue(_targetDebugInfo));
            //propertySetter.SetOutputQueueFactory(() => ReflectBlockExtensions.GetOutputQueue(_sourceDebugInfo));
            propertySetter.SetPostponedMessagesFactory(() => ReflectBlockExtensions.GetProsponedQueue(_targetDebugInfo));

            propertySetter.AddProperty("Current Parallelism", () => ReflectBlockExtensions.GetCurrentDegreeOfParallelism(_targetDebugInfo), 60, Colors.WhiteSmoke);

            //propertySetter.SetBlockOptions(ReflectBlockExtensions.GetDataflowBlockOptions(_targetDebugInfo));
        }
        private void InitProperties(IDataflowBlock block, IBlockInitializer propertySetter)
        {
            propertySetter.SetInputQueueFactory(() => ReflectBlockExtensions.GetInputQueue(_debugInfo));
            propertySetter.SetPostponedMessagesFactory(() => ReflectBlockExtensions.GetProsponedQueue(_debugInfo));

            propertySetter.AddProperty("Current Parallelism", () => ReflectBlockExtensions.GetCurrentDegreeOfParallelism(_debugInfo), 60, Colors.WhiteSmoke);
            propertySetter.AddProperty("Is Completed", () => ReflectBlockExtensions.GetIsCompleted(_debugInfo), 61, Colors.WhiteSmoke);
            propertySetter.AddProperty("Declined Permanently", () => ReflectBlockExtensions.GetIsDecliningPermanently(_debugInfo), 62, Colors.WhiteSmoke);


            propertySetter.SetBlockOptions(ReflectBlockExtensions.GetDataflowBlockOptions(_debugInfo));
        }