private void Settings_Load(object sender, EventArgs e)
        {
            userSetting = UserSetting.GetUserSettings();

            TemplatePathTextBox.Text = userSetting.TemplatePath;
            HostnameTextbox.Text = userSetting.SFTPHostname;
            UsernameTextbox.Text = userSetting.SFTPUsername;
            PasswordTextbox.Text = userSetting.SFTPPassword;
            PrefixTextbox.Text = userSetting.MHIPrefix;
            FilenameTextbox.Text = userSetting.Filename;
            FromTextbox.Text = userSetting.FromLine;
            LabelFolderTextBox.Text = userSetting.LabelDirectory;

            foreach (var printer in PrinterSettings.InstalledPrinters)
            {
                PrinterCombo.Items.Add(printer);
            }
            var pIdx = PrinterCombo.Items.IndexOf(userSetting.PrinterName);
            if (pIdx > -1)
                PrinterCombo.SelectedIndex = pIdx;
        }
 public static void SaveUserSettings(UserSetting userSetting)
 {
     userSetting.SaveUserSetting<UserSetting>();
 }
 public static UserSetting GetUserSettings()
 {
     var value = LoadUserSetting<UserSetting>();
     if (value == null)
         value = new UserSetting();
     return value;
 }