private void ShowAbout()
 {
     aboutInfo.Copyright   = ProgramSettings.Default.Copyright;
     aboutInfo.ProductName = ProgramSettings.Default.ProductName;
     aboutInfo.Version     = ProgramSettings.Default.Version;
     aboutInfo.Website     = ProgramSettings.Default.WebSite;
     using (CommonForm fm = new CommonForm())
     {
         UCAbout ucAbout = new UCAbout();
         ucAbout.SetDeviceId("Device ID: " + settings.DeviceAddress);
         ucAbout.SetAboutInfo(aboutInfo);
         fm.AddControlForDialog(ucAbout, "About");
         fm.ShowDialog();
     }
 }
Beispiel #2
0
        private string ObtainPasswordFromSettingsOrUx()
        {
            if (!String.IsNullOrEmpty(syncSettings.Password))
            {
                return(syncSettings.Password);
            }

            using (CommonForm fm = new CommonForm())
            {
                UCPassword ucPassword = new UCPassword();
                fm.AddControlForDialog(ucPassword, "Password");
                if (fm.ShowDialog() == DialogResult.OK)
                {
                    return(ucPassword.Password);
                }
                else
                {
                    return(null);
                }
            }
        }
Beispiel #3
0
        public static bool ShowModal(ApplicationSettingsBase settings)
        {
            if (settings == null)
                throw new ArgumentNullException("settings");

            using (CommonForm fm = new CommonForm())
            {
                UcOptions ucOptions = new UcOptions(settings);
                fm.AddControlForDialog(ucOptions, "Options");
                if (fm.ShowDialog() == DialogResult.OK)
                {
                    settings.Save();
                    return true;
                }
                else
                {
                    settings.Reload();
                    return false;
                }
            }

        }