Browse Source

Наконец-то увидел оригинальный settings и перенес все туда -_-

master
Никита 6 years ago
parent
commit
d21371cfd6
  1. 12
      fileFinder/App.config
  2. 10
      fileFinder/MainForm.cs
  3. 62
      fileFinder/MainSettings.Designer.cs
  4. 28
      fileFinder/MainSettings.cs
  5. 15
      fileFinder/MainSettings.settings
  6. 66
      fileFinder/Properties/Settings.Designer.cs
  7. 20
      fileFinder/Properties/Settings.settings
  8. 10
      fileFinder/fileFinder.csproj

12
fileFinder/App.config

@ -2,6 +2,7 @@
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="fileFinder.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="fileFinder.MainSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
@ -9,6 +10,17 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<userSettings>
<fileFinder.Properties.Settings>
<setting name="fileUrl" serializeAs="String">
<value>C:\nextcloud\</value>
</setting>
<setting name="fileNameQuery" serializeAs="String">
<value>*</value>
</setting>
<setting name="fileInnerQuery" serializeAs="String">
<value>sh</value>
</setting>
</fileFinder.Properties.Settings>
<fileFinder.MainSettings>
<setting name="fileUrl" serializeAs="String">
<value>C:\nextcloud\</value>

10
fileFinder/MainForm.cs

@ -25,7 +25,7 @@ namespace fileFinder
private void restoreLastSession()
{
MainSettings sets = MainSettings.Default;
var sets = Properties.Settings.Default;
fileUrlTextBox.Text = sets.fileUrl;
innerQueryTextBox.Text = sets.fileInnerQuery;
nameQueryTextBox.Text = sets.fileNameQuery;
@ -170,10 +170,10 @@ namespace fileFinder
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
MainSettings.Default.fileUrl = fileUrlTextBox.Text;
MainSettings.Default.fileNameQuery = nameQueryTextBox.Text;
MainSettings.Default.fileInnerQuery = innerQueryTextBox.Text;
MainSettings.Default.Save();
Properties.Settings.Default.fileUrl = fileUrlTextBox.Text;
Properties.Settings.Default.fileNameQuery = nameQueryTextBox.Text;
Properties.Settings.Default.fileInnerQuery = innerQueryTextBox.Text;
Properties.Settings.Default.Save();
}
private void fileUrlTextBox_TextChanged(object sender, EventArgs e)

62
fileFinder/MainSettings.Designer.cs

@ -1,62 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace fileFinder {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
internal sealed partial class MainSettings : global::System.Configuration.ApplicationSettingsBase {
private static MainSettings defaultInstance = ((MainSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new MainSettings())));
public static MainSettings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("C:\\nextcloud\\")]
public string fileUrl {
get {
return ((string)(this["fileUrl"]));
}
set {
this["fileUrl"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("*")]
public string fileNameQuery {
get {
return ((string)(this["fileNameQuery"]));
}
set {
this["fileNameQuery"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("sh")]
public string fileInnerQuery {
get {
return ((string)(this["fileInnerQuery"]));
}
set {
this["fileInnerQuery"] = value;
}
}
}
}

28
fileFinder/MainSettings.cs

@ -1,28 +0,0 @@
namespace fileFinder {
// Этот класс позволяет обрабатывать определенные события в классе параметров:
// Событие SettingChanging возникает перед изменением значения параметра.
// Событие PropertyChanged возникает после изменения значения параметра.
// Событие SettingsLoaded возникает после загрузки значений параметров.
// Событие SettingsSaving возникает перед сохранением значений параметров.
internal sealed partial class MainSettings {
public MainSettings() {
// // Для добавления обработчиков событий для сохранения и изменения параметров раскомментируйте приведенные ниже строки:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// Добавьте здесь код для обработки события SettingChangingEvent.
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// Добавьте здесь код для обработки события SettingsSaving.
}
}
}

15
fileFinder/MainSettings.settings

@ -1,15 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="fileFinder" GeneratedClassName="MainSettings">
<Profiles />
<Settings>
<Setting Name="fileUrl" Type="System.String" Scope="User">
<Value Profile="(Default)">C:\nextcloud\</Value>
</Setting>
<Setting Name="fileNameQuery" Type="System.String" Scope="User">
<Value Profile="(Default)">*</Value>
</Setting>
<Setting Name="fileInnerQuery" Type="System.String" Scope="User">
<Value Profile="(Default)">sh</Value>
</Setting>
</Settings>
</SettingsFile>

66
fileFinder/Properties/Settings.Designer.cs

@ -1,30 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace fileFinder.Properties
{
namespace fileFinder.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("C:\\nextcloud\\")]
public string fileUrl {
get {
return ((string)(this["fileUrl"]));
}
set {
this["fileUrl"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("*")]
public string fileNameQuery {
get {
return ((string)(this["fileNameQuery"]));
}
set {
this["fileNameQuery"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("sh")]
public string fileInnerQuery {
get {
return ((string)(this["fileInnerQuery"]));
}
set {
this["fileInnerQuery"] = value;
}
}
}
}

20
fileFinder/Properties/Settings.settings

@ -1,7 +1,15 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="fileFinder.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="fileUrl" Type="System.String" Scope="User">
<Value Profile="(Default)">C:\nextcloud\</Value>
</Setting>
<Setting Name="fileNameQuery" Type="System.String" Scope="User">
<Value Profile="(Default)">*</Value>
</Setting>
<Setting Name="fileInnerQuery" Type="System.String" Scope="User">
<Value Profile="(Default)">sh</Value>
</Setting>
</Settings>
</SettingsFile>

10
fileFinder/fileFinder.csproj

@ -51,12 +51,6 @@
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="MainSettings.cs" />
<Compile Include="MainSettings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>MainSettings.settings</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="ProgressReportModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@ -75,10 +69,6 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="MainSettings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>MainSettings.Designer.cs</LastGenOutput>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

Loading…
Cancel
Save