locked
With ... End With statement RRS feed

  • Question

  • Hi, is there a csharp equivalent to "Width ... End With" statment?, thanks.
    • Moved by edhickey Monday, August 16, 2010 8:28 PM (From:.NET 3.0/3.5 Windows Workflow Foundation)
    Monday, August 16, 2010 2:52 PM

Answers

  • Short answer: no.

    The only construct that has some similarity is the C# 3 initialization syntax:

    MyClass foo = new MyClass {
      Property1 = 10,
      Property2 = "Hello"
    };

    which is shorthand for:

    MyClass foo = new MyClass ();
    foo.Property1 = 100;
    foo.Property2 = "Hello";

    HTH
    --mc

    • Marked as answer by Dragula78 Monday, August 16, 2010 9:23 PM
    Monday, August 16, 2010 9:04 PM
  • No, there isn't.
    Zaiden http://zPod.com.ar
    • Marked as answer by Dragula78 Monday, August 16, 2010 9:23 PM
    Monday, August 16, 2010 9:14 PM

All replies

  • Short answer: no.

    The only construct that has some similarity is the C# 3 initialization syntax:

    MyClass foo = new MyClass {
      Property1 = 10,
      Property2 = "Hello"
    };

    which is shorthand for:

    MyClass foo = new MyClass ();
    foo.Property1 = 100;
    foo.Property2 = "Hello";

    HTH
    --mc

    • Marked as answer by Dragula78 Monday, August 16, 2010 9:23 PM
    Monday, August 16, 2010 9:04 PM
  • No, there isn't.
    Zaiden http://zPod.com.ar
    • Marked as answer by Dragula78 Monday, August 16, 2010 9:23 PM
    Monday, August 16, 2010 9:14 PM