Skip to content

Commit

Permalink
Save "full path" setting
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
parnic committed Feb 21, 2025
1 parent 2a1906d commit 0100bed
Show file tree
Hide file tree
Showing 11 changed files with 288 additions and 3 deletions.
12 changes: 11 additions & 1 deletion Dev16-.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\Settings.settings" />
<None Include="OpenFileInSolutionShared\app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings1.Designer.cs</LastGenOutput>
</None>
<Content Include="SharedContent\LICENSE">
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand All @@ -94,6 +98,12 @@
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs" />
<Compile Include="Properties\Settings1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Settings.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="SharedContent\openfileinsolution.png" />
Expand Down
11 changes: 10 additions & 1 deletion Dev17/Dev17+.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs" />
<Compile Include="Properties\Settings1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="..\SharedContent\LICENSE">
Expand All @@ -55,7 +60,11 @@
<VSIXSubPath>SharedContent</VSIXSubPath>
<TargetPath>LICENSE</TargetPath>
</Content>
<None Include="Properties\Settings.settings" />
<None Include="OpenFileInSolutionShared\app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings1.Designer.cs</LastGenOutput>
</None>
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
Expand Down
15 changes: 15 additions & 0 deletions Dev17/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Dev17/Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="PerniciousGames.OpenFileInSolution.Properties" GeneratedClassName="Settings">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Dev17.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="Height" Type="System.Double" Scope="User">
Expand All @@ -17,5 +17,8 @@
<Setting Name="WindowState" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="bSearchFullPath" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
98 changes: 98 additions & 0 deletions Dev17/Properties/Settings1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions OpenFileInSolutionShared/ListFiles.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public ListFiles(IEnumerable<ProjectItemWrapper> inItems)
viewSource = new CollectionViewSource();
viewSource.Source = items;

bSearchFullPath = Properties.Settings.Default.bSearchFullPath;

InitializeComponent();

viewSource.Filter += FilterProjectItems;
Expand Down Expand Up @@ -397,6 +399,7 @@ private void SaveWindowSettings()
Properties.Settings.Default.Top = RestoreBounds.Top;
Properties.Settings.Default.Left = RestoreBounds.Left;
Properties.Settings.Default.WindowState = (int)this.WindowState;
Properties.Settings.Default.bSearchFullPath = bSearchFullPath;
}
}
}
3 changes: 3 additions & 0 deletions OpenFileInSolutionShared/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<setting name="WindowState" serializeAs="String">
<value>0</value>
</setting>
<setting name="bSearchFullPath" serializeAs="String">
<value>False</value>
</setting>
</PerniciousGames.OpenFileInSolution.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
15 changes: 15 additions & 0 deletions Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
<Setting Name="WindowState" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="bSearchFullPath" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
98 changes: 98 additions & 0 deletions Properties/Settings1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions Settings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace PerniciousGames.OpenFileInSolution.Properties {


// This class allows you to handle specific events on the settings class:
// The SettingChanging event is raised before a setting's value is changed.
// The PropertyChanged event is raised after a setting's value is changed.
// The SettingsLoaded event is raised after the setting values are loaded.
// The SettingsSaving event is raised before the setting values are saved.
internal sealed partial class Settings {

public Settings() {
// // To add event handlers for saving and changing settings, uncomment the lines below:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}

private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// Add code to handle the SettingChangingEvent event here.
}

private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// Add code to handle the SettingsSaving event here.
}
}
}

0 comments on commit 0100bed

Please sign in to comment.