Example #1
0
 public static Image GetImage(int width)
 {
     if (_singleton == null)
     {
         _singleton = new SettingsProtectionSingleton();
     }
     if (_singleton.config.RequirePassword)
     {
         if (width > 16)
         {
             return(_singleton.config.NormallyHidden ? SettingsProtectionIcons.lockClosedHidden48x48 : SettingsProtectionIcons.lockClosed48x48);
         }
         else
         {
             return(_singleton.config.NormallyHidden ? SettingsProtectionIcons.lockClosedHidden16x16 : SettingsProtectionIcons.lockClosed16x16);
         }
     }
     else
     {
         if (width > 16)
         {
             return(_singleton.config.NormallyHidden ? SettingsProtectionIcons.lockOpenHidden48x48 : SettingsProtectionIcons.lockOpen48x48);
         }
         else
         {
             return(_singleton.config.NormallyHidden ? SettingsProtectionIcons.lockOpenHidden16x16 : SettingsProtectionIcons.lockOpen16x16);
         }
     }
 }
 public static Image GetImage(int width)
 {
     if (_singleton == null)
     {
         _singleton = new SettingsProtectionSingleton();
     }
     if(_singleton.config.RequirePassword)
     {
         if(width>16)
             return _singleton.config.NormallyHidden ? SettingsProtectionIcons.lockClosedHidden48x48 : SettingsProtectionIcons.lockClosed48x48;
         else
         {
             return _singleton.config.NormallyHidden ? SettingsProtectionIcons.lockClosedHidden16x16 : SettingsProtectionIcons.lockClosed16x16;
         }
     }
     else
     {
         if (width > 16)
             return _singleton.config.NormallyHidden ? SettingsProtectionIcons.lockOpenHidden48x48 : SettingsProtectionIcons.lockOpen48x48;
         else
         {
             return _singleton.config.NormallyHidden ? SettingsProtectionIcons.lockOpenHidden16x16 : SettingsProtectionIcons.lockOpen16x16;
         }
     }
 }
Example #3
0
 private void UpdateDisplay()
 {
     _image.Image = SettingsProtectionSingleton.GetImage(32);
 }
 private void OnRequirePasswordCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     SettingsProtectionSingleton.Settings.RequirePassword = _requirePasswordCheckBox.Checked;
     _image.Image = SettingsProtectionSingleton.GetImage(48);
 }
 private void OnNormallHidden_CheckedChanged(object sender, EventArgs e)
 {
     SettingsProtectionSingleton.Settings.NormallyHidden = _normallyHiddenCheckbox.Checked;
     _image.Image = SettingsProtectionSingleton.GetImage(48);
 }