<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
+ <appSettings>
+ <add key="DisableBusyIndicator" value="false" />
+ </appSettings>
</configuration>
\ No newline at end of file
<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<Reference Include="PresentationCore" />
<Compile Include="Controls\PasswordToggleBox.xaml.cs">
<DependentUpon>PasswordToggleBox.xaml</DependentUpon>
</Compile>
+ <Compile Include="Utilities\ApplicationConfig.cs" />
<Compile Include="Utilities\CPUFeatures.cs" />
<Compile Include="Process\SlunkCryptRunner.cs" />
<Compile Include="Utilities\BusyManager.cs" />
public event PropertyChangedEventHandler PropertyChanged;
public const int MIN_PASSWD_LENGTH = 8, REC_PASSWD_LENGTH = 12, GEN_PASSWD_LENGTH = 24, MAX_PASSWD_LENGTH = 256, MAX_PATH = 259;
+ private readonly ApplicationConfig m_config = new ApplicationConfig();
private readonly Lazy<string> m_about = new Lazy<string>(CreateAboutText);
private readonly Random m_random = new Random();
private readonly ObservableCollection<string> m_logFile = new ObservableCollection<string>();
m_dispatcherTimer.Tick += DispatcherTimer_Tick;
m_dispatcherTimer.Interval = TimeSpan.FromMilliseconds(200);
m_logFileReadOnly = new ReadOnlyObservableCollection<string>(m_logFile);
+ m_disableAnimation = m_config.DisableBusyIndicator;
}
// =============================================================================
SystemMenu systemMenu = new SystemMenu(this, SystemMenu_Activated);
m_menuId_disableAnimation = systemMenu.AppendMenu("Disable Busy Indicator");
m_menuId_enableExpertMode = systemMenu.AppendMenu("Expert Settings");
+ if (m_disableAnimation && m_menuId_disableAnimation.HasValue)
+ {
+ systemMenu.ModifyMenu(m_menuId_disableAnimation.Value, m_disableAnimation);
+ }
CreateIndicatorElements();
}
--- /dev/null
+/******************************************************************************/
+/* SlunkCrypt, by LoRd_MuldeR <MuldeR2@GMX.de> */
+/* This work has been released under the CC0 1.0 Universal license! */
+/******************************************************************************/
+
+using System;
+using System.Configuration;
+
+namespace com.muldersoft.slunkcrypt.gui.utils
+{
+ class ApplicationConfig
+ {
+ private readonly Lazy<KeyValueConfigurationCollection> m_settings = new Lazy<KeyValueConfigurationCollection>(InitializeSettings);
+
+ public bool DisableBusyIndicator
+ {
+ get
+ {
+ return GetConfigValueAsBool("DisableBusyIndicator");
+ }
+ }
+
+ protected string GetConfigValue(string name)
+ {
+ KeyValueConfigurationCollection settings = m_settings.Value;
+ if (!ReferenceEquals(settings, null))
+ {
+ KeyValueConfigurationElement element = settings[name];
+ if (!ReferenceEquals(element, null))
+ {
+ string value = element.Value;
+ return string.IsNullOrWhiteSpace(value) ? string.Empty : value;
+ }
+ }
+ return string.Empty;
+ }
+
+ protected bool GetConfigValueAsBool(string name)
+ {
+ string value;
+ if (!string.IsNullOrWhiteSpace(value = GetConfigValue(name)))
+ {
+ bool result;
+ if (bool.TryParse(value.Trim(), out result))
+ {
+ return result;
+ }
+ }
+ return false;
+ }
+
+ private static KeyValueConfigurationCollection InitializeSettings()
+ {
+ try
+ {
+ Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+ return configuration.AppSettings.Settings;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+ }
+}