示例#1
0
        private void ItemListDoubleClicked(object sender, MouseButtonEventArgs e)
        {
            if (CollectionValues.SelectedIndex < 0)
            {
                return;
            }
            DisplayableString item = (DisplayableString)CollectionValues.SelectedItem;

            if (_instanceValue.Fields != null && _instanceValue.Fields.Length == 1 && _instanceValue.Fields[0].Kind == ClrElementKind.String)
            {
                if (!item.IsLong())
                {
                    return;
                }
                var fld  = _instanceValue.Fields[0];
                var inst = new InstanceValue(fld.TypeId, fld.Address, fld.TypeName, string.Empty, item.FullContent);
                Dispatcher.CurrentDispatcher.InvokeAsync(() => ValueWindows.ShowContentWindow(fld.GetDescription(), inst, ValueWindows.WndType.Content));
                return;
            }
            ulong addr = GetAddressFromEntry(item.FullContent);

            if (addr != Constants.InvalidAddress)
            {
                Dispatcher.CurrentDispatcher.InvokeAsync(() => ((MainWindow)Owner).ExecuteInstanceValueQuery("Getting object value at: " + Utils.RealAddressString(addr), addr));
            }
        }
示例#2
0
        private void CopyItemSelectionClicked(object sender, RoutedEventArgs e)
        {
            if (CollectionValues.SelectedIndex < 0)
            {
                return;
            }
            DisplayableString item  = (DisplayableString)CollectionValues.SelectedItem;
            string            value = item.FullContent;

            GuiUtils.CopyToClipboard(value);
        }
示例#3
0
        private void GetInstValueClicked(bool forKey)
        {
            string value = GetSelectionString(forKey); // true for key

            if (value == null)
            {
                return;
            }
            ulong addr = GetAddressFromEntry(value);

            if (addr != Constants.InvalidAddress)
            {
                System.Windows.Threading.Dispatcher.CurrentDispatcher.InvokeAsync(() => ((MainWindow)Owner).ExecuteInstanceValueQuery("Getting object value at: " + Utils.RealAddressString(addr), addr));
            }
            if (DisplayableString.IsLargeString(value))
            {
                var inst = new InstanceValue(Constants.InvalidIndex, ClrElementKind.Unknown, Constants.InvalidAddress, "FROM: " + _instValue.TypeName, null, value);
                ValueWindows.ShowContentWindow("A collection item " + (forKey ? "key." : "value."), inst, ValueWindows.WndType.Content);
                return;
            }
            ((MainWindow)Owner).MainStatusShowMessage("The value requested cannot be elaborated more. The values is what you see.");
        }
示例#4
0
 private void ShowArrayIndicesClicked(object sender, RoutedEventArgs e)
 {
     if (_indicesShown)
     {
         CollectionValues.ItemsSource = _instanceValue.ArrayValues;
         _indicesShown = false;
     }
     else
     {
         DisplayableString[] values = _instanceValue.ArrayValues;
         Debug.Assert(values != null);
         int cnt        = values.Length;
         int digitCount = Utils.NumberOfDigits(cnt);
         DisplayableString[] newValues = new DisplayableString[cnt];
         string format = "[{0," + digitCount.ToString() + ":#,###,###}] ";
         for (int i = 0, icnt = values.Length; i < icnt; ++i)
         {
             newValues[i] = new DisplayableString(Utils.SizeStringHeader(i, digitCount, format) + values[i]);
         }
         _indicesShown = true;
         CollectionValues.ItemsSource = newValues;
     }
 }