Wednesday, 6 July 2016

Constructor Overloading



  Constructor Overloading:






public class Messageconstruct
    {

#region Constructors
        public Messageconstruct()
            : base()
        {
            //Not Implemented
        }

        public Messageconstruct(string Name)
            : this()
        {
            this.Name = Name;
        }

        public Messageconstruct(string Name, string Type, string Text)
            : this()
        {
            this.Name = Name;
            this.Type = Type;
            this.Text = Text;
          
        }

        public Message(string Name, string Type, string Text, string fields)
            : this()
        {
            this.Name = Name;
            this.Type = Type;
            this.Text = Text;
            if (!string.IsNullOrEmpty(fields))
                this.Fields = fields;
        }
#endregion

}

No comments:

Post a Comment