automatic-properties

Property that can rearrange components when I am changing size of windows applications

Are there any property of a form or a component by which components of windows applications created using Visual Studio will be arranged automatically when I changed the windows size or maximized - restored the window? If not, How can I do it manually? ...

The case against automatic properties

Possible Duplicate: C# 3.0 Auto-Properties - useful or not? My boss and I regularly argue about the benefits and disadvantages of using automatic properties. public string Name { get; set; } vs private string name; public string Name { get { return this.name; } set { this.name = value; } } For I am strongly i...

Explicit implementation of an interface using an automatic property

Is there any way to implement an interface explicitly using an automatic property? For instance, consider this code: namespace AutoProperties { interface IMyInterface { bool MyBoolOnlyGet { get; } } class MyClass : IMyInterface { static void Main(){} public bool MyBoolOnlyGet { get; private ...

Is there a technical reason why an automatic property must define both a get and set accessor

I know that automatic properties must define a get and set accessor method, I also know that it is possible for either of these accessors to be made invisible by means of an access modifier. Is there a technical reason why the compiler is happy with public object Property { get; set; } but not public object Property { get; } My (p...

C# Lazy Loaded Automatic Properties

In C#, Is there a way to turn an automatic property into a lazy loaded automatic property with a specified default value? Essentially, I am trying to turn this... private string _SomeVariable public string SomeVariable { get { if(_SomeVariable == null) { _SomeVariable = SomeClass.IOnlyWantTo...