Пример #1
0
 private void Parameters_Load(object sender, EventArgs e)
 {
     ProgParams = this.ProgParams.Load();
     txtConnectionString.Text = ProgParams.ServerConnectionString;
     txtSharedFolder.Text = ProgParams.FolderPath;
     txtAdminPassword.Text = ProgParams.UserPassword;
     txtAdminAccount.Text = ProgParams.UserAccount;
 }
Пример #2
0
        public ProgParams Load()
        {
            System.Xml.Serialization.XmlSerializer reader =
            new System.Xml.Serialization.XmlSerializer(typeof(ProgParams));
            System.IO.StreamReader file = new System.IO.StreamReader(AppDomain.CurrentDomain.BaseDirectory +
                   @"..\..\xml\ProgParams.xml");
            ProgParams pparam = new ProgParams();
            try
            {
                pparam = (ProgParams)reader.Deserialize(file);
                pparam.IsSet = true;
                pparam.UserPassword =  pparam.decryptedPassword(pparam.UserPassword);
            }
            catch(Exception)
            {
                pparam.IsSet = false;
            }

            file.Close();
            return pparam;
        }
Пример #3
0
 private void loadProgParams()
 {
     ProgParams = ProgParams.Load();
     if (!ProgParams.IsSet)
     {
         Parameters frmParams = new Parameters();
         frmParams.ShowDialog();
         if (frmParams.DialogResult == DialogResult.OK)
         {
             ProgParams = frmParams.getParams();
         }
     }
 }
Пример #4
0
 public Parameters(SeedingProgramV2.ProgParams AppProgParams)
 {
     ProgParams = AppProgParams;
     txtConnectionString.Text = ProgParams.ServerConnectionString;
 }
Пример #5
0
 private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Parameters frmParams = new Parameters();
     frmParams.ShowDialog();
     if (frmParams.DialogResult == DialogResult.OK)
     {
         ProgParams = frmParams.getParams();
     }
 }