예제 #1
0
        public void AddItem(TraceListItemType type, long timeStamp, string sourceName, string message
                            , object[] data = null, System.Action onClick = null)
        {
            if (PauseTracing)
            {
                // #NOTE_PHXSTUDIO I think I still want to track the total number of would-be traces
                ++mItemNumber;
                TotalNumberOfTraces = mItemNumber;
                return;
            }

            var settings      = PhxStudio.Properties.Settings.Default;
            var traceSettings = settings.TraceSourceOptions;

            if (traceSettings != null)
            {
                if (traceSettings.MaxTraceListItems.IsNotNone())
                {
                    int surplus_count = Items.Count;
                    surplus_count += 1;                     // we're adding one
                    surplus_count -= traceSettings.MaxTraceListItems;
                    while (surplus_count-- > 0)
                    {
                        Items.RemoveAt(0);
                    }
                }
            }

            var item = new TraceListItem
            {
                ItemType   = type,
                Number     = ++mItemNumber,
                TimeStamp  = timeStamp,
                SourceName = sourceName,
                Message    = message,
                Data       = data,
                OnClick    = onClick,
            };

            Items.Add(item);
            TotalNumberOfTraces = mItemNumber;
        }
예제 #2
0
        public void OnSelectedItemChanged(TraceListItem selectedItem)
        {
            if (mInspectorTool == null)
            {
                return;
            }

            if (selectedItem == null)
            {
                mInspectorTool.SelectedObject = null;
                return;
            }

            var item_inspector = new InspectableObjectBuilder()
                                 .WithObjectProperties(selectedItem, TraceListItemPropertyFilter);

            if (selectedItem.HasData)
            {
                item_inspector
                .WithEditor(selectedItem, x => x.Data, new Inspectors.TraceDataEditorViewModel());
            }

            mInspectorTool.SelectedObject = item_inspector.ToInspectableObject();
        }