Click here to Skip to main content
15,917,321 members
Home / Discussions / C#
   

C#

 
QuestionNeed help with understanding Reflection Pin
madhatter84gn15-Jan-09 7:05
madhatter84gn15-Jan-09 7:05 
AnswerRe: Need help with understanding Reflection Pin
Scott Dorman15-Jan-09 7:45
professionalScott Dorman15-Jan-09 7:45 
GeneralRe: Need help with understanding Reflection Pin
madhatter84gn15-Jan-09 8:06
madhatter84gn15-Jan-09 8:06 
Question[Message Deleted] Pin
hkjghkj115-Jan-09 6:01
hkjghkj115-Jan-09 6:01 
AnswerRe: No background, just *.png with shadow Pin
Henry Minute15-Jan-09 6:38
Henry Minute15-Jan-09 6:38 
QuestionData Grid View Pin
Michael Bookatz15-Jan-09 5:41
Michael Bookatz15-Jan-09 5:41 
AnswerRe: Data Grid View Pin
EliottA15-Jan-09 5:43
EliottA15-Jan-09 5:43 
GeneralRe: Data Grid View Pin
Michael Bookatz15-Jan-09 5:48
Michael Bookatz15-Jan-09 5:48 
GeneralRe: Data Grid View Pin
Douglas Troy15-Jan-09 8:36
Douglas Troy15-Jan-09 8:36 
QuestionHi adding data's to datatable, Pin
Hema Bairavan15-Jan-09 5:37
Hema Bairavan15-Jan-09 5:37 
GeneralRe: Hi adding data's to datatable, Pin
nelsonpaixao15-Jan-09 5:56
nelsonpaixao15-Jan-09 5:56 
GeneralRe: Hi adding data's to datatable, Pin
Hema Bairavan15-Jan-09 6:04
Hema Bairavan15-Jan-09 6:04 
GeneralRe: Hi adding data's to datatable, Pin
Henry Minute15-Jan-09 6:43
Henry Minute15-Jan-09 6:43 
GeneralRe: Hi adding data's to datatable, Pin
nelsonpaixao15-Jan-09 15:58
nelsonpaixao15-Jan-09 15:58 
QuestionPhilisophical question Pin
Gary Wheeler15-Jan-09 4:38
Gary Wheeler15-Jan-09 4:38 
AnswerRe: Philisophical question [modified] Pin
Douglas Troy15-Jan-09 5:03
Douglas Troy15-Jan-09 5:03 
GeneralRe: Philisophical question Pin
S. Senthil Kumar16-Jan-09 4:32
S. Senthil Kumar16-Jan-09 4:32 
AnswerRe: Philisophical question Pin
#realJSOP15-Jan-09 5:50
professional#realJSOP15-Jan-09 5:50 
AnswerRe: Philisophical question Pin
Scott Dorman15-Jan-09 5:51
professionalScott Dorman15-Jan-09 5:51 
GeneralRe: Philisophical question Pin
carbon_golem15-Jan-09 8:34
carbon_golem15-Jan-09 8:34 
GeneralRe: Philisophical question Pin
Scott Dorman15-Jan-09 8:39
professionalScott Dorman15-Jan-09 8:39 
GeneralRe: Philisophical question Pin
S. Senthil Kumar15-Jan-09 18:28
S. Senthil Kumar15-Jan-09 18:28 
GeneralRe: Philisophical question Pin
carbon_golem16-Jan-09 5:51
carbon_golem16-Jan-09 5:51 
No. If you chain constructors, the compiler is smart enough to put members initialized in the class body into the last chain target. I went back through and verified this. Here is some sample code for you to compile and run ILDasm on. Car has chained constructors, where Truck does not. Truck's constructors all get the initialization code for the CultureInfo member, where Car has the initialization for CultureInfo in the constructor that takes 2 args.

using System;
using System.Globalization;

namespace ConstructorChainKata {
    class Program {
        static void Main(string[] args) {
        }
    }

    public enum Market {
        Production,
        Concept,
        Military,
        Custom,
        Armored
    }

    public class Car {
        private String manufacturer;
        private Market market;
        private CultureInfo targetLocale = new CultureInfo("en-US");

        public Car(String manuf) :this(manuf, Market.Production) {
            //..
        }
        public Car(String manuf, Market markt) {
            manufacturer = manuf;
            market = markt;
        }
    }


    public class Truck {
        private String manufacturer;
        private Market market;
        private CultureInfo targetLocale = new CultureInfo("en-US");

        public Truck(String manuf) {
            manufacturer = manuf;
            market = Market.Production;
        }
        public Truck(String manuf, Market markt) {
            manufacturer = manuf;
            market = markt;
        }
    }
}


Scott P

"Simplicity carried to the extreme becomes elegance."
-Jon Franklin

GeneralRe: Philisophical question Pin
S. Senthil Kumar16-Jan-09 6:58
S. Senthil Kumar16-Jan-09 6:58 
GeneralRe: Philisophical question Pin
Gary Wheeler16-Jan-09 0:41
Gary Wheeler16-Jan-09 0:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.