Skip to content

Commit

Permalink
documented code and restructured files
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrKnarz committed Feb 27, 2023
1 parent 4059b0e commit 2a7ed87
Show file tree
Hide file tree
Showing 18 changed files with 217 additions and 156 deletions.
12 changes: 0 additions & 12 deletions Generic/CompanyCompanion/App.xaml

This file was deleted.

10 changes: 8 additions & 2 deletions Generic/CompanyCompanion/CompanyCompanion.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Playnite.SDK;
using KNARZhelper;
using Playnite.SDK;
using Playnite.SDK.Events;
using Playnite.SDK.Plugins;
using System;
Expand All @@ -8,6 +9,9 @@

namespace CompanyCompanion
{
/// <summary>
/// Class of the actual playnite extension
/// </summary>
public class CompanyCompanion : GenericPlugin
{
public CompanyCompanionSettingsViewModel Settings { get; set; }
Expand All @@ -23,6 +27,9 @@ public CompanyCompanion(IPlayniteAPI api) : base(api)
};
}

/// <summary>
/// Shows the merge companies window.
/// </summary>
public void ShowMergeView()
{
try
Expand All @@ -47,7 +54,6 @@ public void ShowMergeView()
}
}


public override IEnumerable<MainMenuItem> GetMainMenuItems(GetMainMenuItemsArgs args)
{
string menuSection = ResourceProvider.GetString("LOCCompanyCompanionName");
Expand Down
165 changes: 153 additions & 12 deletions Generic/CompanyCompanion/CompanyCompanion.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Playnite.SDK, Version=6.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\PlayniteSDK.6.8.0\lib\net462\Playnite.SDK.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
Expand All @@ -50,41 +47,180 @@
<ItemGroup>
<Compile Include="CompanyCompanion.cs" />
<Compile Include="CompanyCompanionSettings.cs" />
<Compile Include="CompanyCompanionSettingsView.xaml.cs">
<Compile Include="Views\CompanyCompanionSettingsView.xaml.cs">
<DependentUpon>CompanyCompanionSettingsView.xaml</DependentUpon>
</Compile>
<Compile Include="Logging.cs" />
<Compile Include="ViewModels\MergeCompanies.cs" />
<Compile Include="ViewModels\MergeCompaniesViewModel.cs" />
<Compile Include="ViewModels\MergeGroup.cs" />
<Compile Include="ViewModels\MergeItem.cs" />
<Compile Include="ViewModels\ViewModelBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="MergeCompaniesView.xaml.cs">
<Compile Include="Views\MergeCompaniesView.xaml.cs">
<DependentUpon>MergeCompaniesView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="extension.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="Localization\*.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Page Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<Page Include="Views\CompanyCompanionSettingsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CompanyCompanionSettingsView.xaml">
<None Include="Localization\af_ZA.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\ar_SA.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\ca_ES.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\cs_CZ.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\da_DK.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\de_DE.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\el_GR.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\es_ES.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MergeCompaniesView.xaml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\fi_FI.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\fr_FR.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\he_IL.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\hu_HU.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\it_IT.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\ja_JP.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\ko_KR.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\nl_NL.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\no_NO.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\pl_PL.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\pt_BR.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\pt_PT.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\ro_RO.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\ru_RU.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\sr_SP.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\sv_SE.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\tr_TR.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\uk_UA.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\vi_VN.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\zh_CN.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Localization\zh_TW.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Page Include="Views\MergeCompaniesView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand All @@ -100,5 +236,10 @@
<Name>KNARZhelper</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="PlayniteSDK">
<Version>6.8.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
17 changes: 11 additions & 6 deletions Generic/CompanyCompanion/CompanyCompanionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ public class CompanyCompanionSettings : ObservableObject
private ObservableCollection<string> businessEntityDescriptors;
private ObservableCollection<string> ignoreWords;

/// <summary>
/// Defines, if the group key will be shown in the merge companies window.
/// </summary>
public bool ShowGroupKey { get => showGroupKey; set => SetValue(ref showGroupKey, value); }
/// <summary>
/// List of words that will be removed from the games as business entity descriptors.
/// </summary>
public ObservableCollection<string> BusinessEntityDescriptors { get => businessEntityDescriptors; set => SetValue(ref businessEntityDescriptors, value); }
/// <summary>
/// List of words than will be ignored when searching for similar companies.
/// </summary>
public ObservableCollection<string> IgnoreWords { get => ignoreWords; set => SetValue(ref ignoreWords, value); }
}

Expand Down Expand Up @@ -68,11 +77,6 @@ public RelayCommand<IList<object>> RemoveIgnoreWordCommand
}, (items) => items != null && items.Count > 0);
}

internal void SortCollection(ref ObservableCollection<string> collection)
{
collection = new ObservableCollection<string>(collection.OrderBy(x => x));
}

public CompanyCompanionSettings Settings
{
get => settings;
Expand Down Expand Up @@ -111,8 +115,9 @@ public CompanyCompanionSettingsViewModel(CompanyCompanion plugin)
"Inc",
"LLC",
"Ltd",
"S.A.",
"s.r.o.",
"srl",
"sro",
};
}
else
Expand Down
Loading

0 comments on commit 2a7ed87

Please sign in to comment.