this () tips no-argument constructor

In development, the class of this () is a function corresponding to the no-argument constructor. So when you call the constructor have parameters, I want to load the default no-argument constructor can be added after the method body: this ().
public partial class MessageWindow : Window
    {
        public MessageWindow()
        {
            InitializeComponent();
            this.Loaded += IssueMessageWindow_Loaded;
        }
        void IssueMessageWindow_Loaded Private (Object SENDER, the RoutedEventArgs E)
        {
            // the default code implemented
        }
        public MessageWindow(EasyButton easy, string msgInfo) 
        {
            InitializeComponent();
            this.Loaded += IssueMessageWindow_Loaded;
            //实现逻辑
        }
        public MessageWindow(EasyButton easy, string msgInfo, int timeout)
        {
            InitializeComponent();
            this.Loaded += IssueMessageWindow_Loaded;
            //实现逻辑
        }
        public MessageWindow(string msgInfo, int timeout)
        {
            InitializeComponent();
            this.Loaded += IssueMessageWindow_Loaded;
            //实现逻辑
        }
  }
 
 
change to:
 public partial class MessageWindow : Window
    {
        public MessageWindow()
        {
            InitializeComponent();
            this.Loaded += IssueMessageWindow_Loaded;
        }
        void IssueMessageWindow_Loaded Private (Object SENDER, the RoutedEventArgs E)
        {
            // the default code implemented
        }
        the MessageWindow public (EasyButton Easy, String of msginfo): the this ()
        {
            // implementation logic
        }
        the MessageWindow public (EasyButton Easy, String of msginfo, int timeout): the this ()
        {
            // implementation logic
        }
        the MessageWindow public (String of msginfo, int timeout): the this ()
        {
            // implementation logic
        }
  }
 
 
 

Guess you like

Origin www.cnblogs.com/liezhong/p/11389171.html