Showing link address in C # (WCF debugging)

I am debugging a two-way WCF project. I have a callback with data that I store in an array, client, WinForm and use it to draw a control. As you can guess, the data disappears from the record in the array (really a list) when I read the data.

For debugging, I would like to see if there is a write and read of the same object so that the callback function does not create any copy and does not discard it. For example, I want to see the address of this pointer. How to do it in VS2010 Exp?

Edit
Some code:

Field declaration:

    // the cards that the player have
    private List<Card> cards = new List<Card>();

callback handler:

    private void btnDraw_Click(object sender, EventArgs e)
    {
        Tuple<Card, string> update = PressedDraw(this);
        cards.Add(update.Item1);
        PaintCards();
    }

drawing event:

   private void cardPanel_Paint(object sender, PaintEventArgs e)
    {
        int counter = 0;
        Point fromCorner = new Point(20,12);
        int distance = 50;
        foreach (Card card in cards)
        {
            Point pos = fromCorner;
            pos.Offset(counter++ * distance, 0);
            Bitmap cardBitmap = 
                cardFaces[Convert.ToInt32(card.suit), 
                   Convert.ToInt32(card.rank)];

            Rectangle square = new Rectangle(pos, cardBitmap.Size);
            e.Graphics.DrawImage(cardBitmap, square);
        }

, Card cards
PaintCards() Invalidate paint. cardPanel_Paint, cards.Count .

. Gรถrgen

+3
2

Watch/Locals/Autos " ", . ; .

, , - , . .

.

alt text

+13

# , ( ).

Object.ReferenceEquals , , .

Edit:
, - .

var a = new List<string> { "String1" };
var b = a;
a = new List<string> { "String 2" }; // really GetListFromWcf();
Console.WriteLine(b[0]);

String1, String2.

, , , - .

+1

Source: https://habr.com/ru/post/1772798/


All Articles