diff --git a/Generic/CompanyCompanion/App.xaml b/Generic/CompanyCompanion/App.xaml
deleted file mode 100644
index 0e3490bb1..000000000
--- a/Generic/CompanyCompanion/App.xaml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Generic/CompanyCompanion/CompanyCompanion.cs b/Generic/CompanyCompanion/CompanyCompanion.cs
index a295491aa..5686f5a9e 100644
--- a/Generic/CompanyCompanion/CompanyCompanion.cs
+++ b/Generic/CompanyCompanion/CompanyCompanion.cs
@@ -1,4 +1,5 @@
-using Playnite.SDK;
+using KNARZhelper;
+using Playnite.SDK;
using Playnite.SDK.Events;
using Playnite.SDK.Plugins;
using System;
@@ -8,6 +9,9 @@
namespace CompanyCompanion
{
+ ///
+ /// Class of the actual playnite extension
+ ///
public class CompanyCompanion : GenericPlugin
{
public CompanyCompanionSettingsViewModel Settings { get; set; }
@@ -23,6 +27,9 @@ public CompanyCompanion(IPlayniteAPI api) : base(api)
};
}
+ ///
+ /// Shows the merge companies window.
+ ///
public void ShowMergeView()
{
try
@@ -47,7 +54,6 @@ public void ShowMergeView()
}
}
-
public override IEnumerable GetMainMenuItems(GetMainMenuItemsArgs args)
{
string menuSection = ResourceProvider.GetString("LOCCompanyCompanionName");
diff --git a/Generic/CompanyCompanion/CompanyCompanion.csproj b/Generic/CompanyCompanion/CompanyCompanion.csproj
index ce8eb03c8..703106cc0 100644
--- a/Generic/CompanyCompanion/CompanyCompanion.csproj
+++ b/Generic/CompanyCompanion/CompanyCompanion.csproj
@@ -31,9 +31,6 @@
4
-
- ..\..\packages\PlayniteSDK.6.8.0\lib\net462\Playnite.SDK.dll
-
@@ -50,17 +47,16 @@
-
+
CompanyCompanionSettingsView.xaml
-
-
+
MergeCompaniesView.xaml
@@ -68,7 +64,6 @@
PreserveNewest
-
@@ -76,15 +71,156 @@
Designer
PreserveNewest
-
- MSBuild:Compile
+
Designer
+ MSBuild:Compile
-
+
+ MSBuild:Compile
Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
MSBuild:Compile
-
-
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
Designer
MSBuild:Compile
@@ -100,5 +236,10 @@
KNARZhelper
+
+
+ 6.8.0
+
+
\ No newline at end of file
diff --git a/Generic/CompanyCompanion/CompanyCompanionSettings.cs b/Generic/CompanyCompanion/CompanyCompanionSettings.cs
index 8a3f6d1aa..a91f1fd28 100644
--- a/Generic/CompanyCompanion/CompanyCompanionSettings.cs
+++ b/Generic/CompanyCompanion/CompanyCompanionSettings.cs
@@ -12,8 +12,17 @@ public class CompanyCompanionSettings : ObservableObject
private ObservableCollection businessEntityDescriptors;
private ObservableCollection ignoreWords;
+ ///
+ /// Defines, if the group key will be shown in the merge companies window.
+ ///
public bool ShowGroupKey { get => showGroupKey; set => SetValue(ref showGroupKey, value); }
+ ///
+ /// List of words that will be removed from the games as business entity descriptors.
+ ///
public ObservableCollection BusinessEntityDescriptors { get => businessEntityDescriptors; set => SetValue(ref businessEntityDescriptors, value); }
+ ///
+ /// List of words than will be ignored when searching for similar companies.
+ ///
public ObservableCollection IgnoreWords { get => ignoreWords; set => SetValue(ref ignoreWords, value); }
}
@@ -68,11 +77,6 @@ public RelayCommand> RemoveIgnoreWordCommand
}, (items) => items != null && items.Count > 0);
}
- internal void SortCollection(ref ObservableCollection collection)
- {
- collection = new ObservableCollection(collection.OrderBy(x => x));
- }
-
public CompanyCompanionSettings Settings
{
get => settings;
@@ -111,8 +115,9 @@ public CompanyCompanionSettingsViewModel(CompanyCompanion plugin)
"Inc",
"LLC",
"Ltd",
+ "S.A.",
+ "s.r.o.",
"srl",
- "sro",
};
}
else
diff --git a/Generic/CompanyCompanion/Logging.cs b/Generic/CompanyCompanion/Logging.cs
deleted file mode 100644
index 9fc60047c..000000000
--- a/Generic/CompanyCompanion/Logging.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-using Playnite.SDK;
-using System;
-using System.Diagnostics;
-using System.Linq;
-using System.Reflection;
-
-namespace CompanyCompanion
-{
- ///
- /// Unifies writing messages into the extension.log
- ///
- public class Log
- {
- ///
- /// Logger instance from playnite
- ///
- private static readonly ILogger logger = LogManager.GetLogger();
-
- ///
- /// Logs an error message.
- ///
- /// The exception to log
- /// Optional message. If the message is empty the calling function will be added to the error message
- /// Additionally shows the error message as a dialog if set to true.
- public static void Error(Exception ex, string Message = "", bool showDialog = false)
- {
- TraceInfos traceInfos = new TraceInfos(ex);
-
- if (string.IsNullOrEmpty(Message) && !string.IsNullOrEmpty(traceInfos.InitialCaller))
- {
- Message = $"Error on {traceInfos.InitialCaller}()";
- }
-
- Message += $"|{traceInfos.FileName}|{traceInfos.LineNumber}";
-
- logger.Error(ex, $"{Message}");
-
- if (showDialog)
- {
- API.Instance.Dialogs.ShowErrorMessage(Message);
- }
- }
-
- ///
- /// Logs an info message.
- ///
- /// The Message to log
- /// Additionally shows the error message as a dialog if set to true.
- public static void Info(string Message, bool showDialog = false)
- {
- logger.Info($"{Message}");
-
- if (showDialog)
- {
- API.Instance.Dialogs.ShowMessage(Message);
- }
- }
-
- ///
- /// Logs a debug message.
- ///
- /// The Message to log
- public static void Debug(string Message)
- {
- logger.Debug($"{Message}");
- }
- }
-
- ///
- /// Retrieves the trace infos from an exception.
- ///
- public class TraceInfos
- {
- ///
- /// The Calling function of the exception
- ///
- public string InitialCaller { get; set; }
- ///
- /// Parameters of the caller function
- ///
- public ParameterInfo[] CallerParams { get; set; }
- ///
- /// Name of the file the error occurred in.
- ///
- public string FileName { get; set; }
- ///
- /// Number of the line the error occurred in.
- ///
- public int LineNumber { get; set; }
-
- ///
- /// Retrieves the trace infos from an exception.
- ///
- /// Exception to process
- public TraceInfos(Exception ex)
- {
- StackTrace Trace = new StackTrace(ex, true);
- StackFrame Frame = Trace.GetFrames()?.LastOrDefault();
- InitialCaller = Frame?.GetMethod()?.Name;
- CallerParams = Frame?.GetMethod()?.GetParameters();
- FileName = string.IsNullOrEmpty(Frame.GetFileName()) ? "???" : Frame.GetFileName();
- LineNumber = Frame.GetFileLineNumber();
- }
- }
-}
diff --git a/Generic/CompanyCompanion/Properties/AssemblyInfo.cs b/Generic/CompanyCompanion/Properties/AssemblyInfo.cs
index 177fe0cd5..fc19c7962 100644
--- a/Generic/CompanyCompanion/Properties/AssemblyInfo.cs
+++ b/Generic/CompanyCompanion/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
@@ -32,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
+[assembly: AssemblyVersion("0.2.0.0")]
+[assembly: AssemblyFileVersion("0.2.0.0")]
\ No newline at end of file
diff --git a/Generic/CompanyCompanion/ViewModels/MergeCompaniesViewModel.cs b/Generic/CompanyCompanion/ViewModels/MergeCompaniesViewModel.cs
index ae44f93c8..ebf00ece5 100644
--- a/Generic/CompanyCompanion/ViewModels/MergeCompaniesViewModel.cs
+++ b/Generic/CompanyCompanion/ViewModels/MergeCompaniesViewModel.cs
@@ -2,6 +2,9 @@
namespace CompanyCompanion
{
+ ///
+ /// View model for the merge companies window
+ ///
public class MergeCompaniesViewModel : ViewModelBase
{
private MergeCompanies mergeCompanies;
diff --git a/Generic/CompanyCompanion/ViewModels/MergeGroup.cs b/Generic/CompanyCompanion/ViewModels/MergeGroup.cs
index 7c79b8eca..22a4fa77e 100644
--- a/Generic/CompanyCompanion/ViewModels/MergeGroup.cs
+++ b/Generic/CompanyCompanion/ViewModels/MergeGroup.cs
@@ -14,8 +14,10 @@ public class MergeGroup : ViewModelBase
private string companyName = string.Empty;
private Guid companyId = Guid.Empty;
+ ///
+ /// Company Companion plugin. Used to access settings etc.
+ ///
public CompanyCompanion Plugin { get; set; }
-
///
/// Owner of the group. Used to merge one group.
///
@@ -39,7 +41,6 @@ public string CompanyName
OnPropertyChanged("CompanyName");
}
}
-
///
/// Name to display
///
@@ -57,7 +58,6 @@ public string DisplayName
}
}
}
-
///
/// Id of the masterCompany
///
@@ -73,12 +73,16 @@ public Guid CompanyId
OnPropertyChanged("CompanyId");
}
}
-
///
/// Collection of all companies that will be merged.
///
public List Companies { get; set; }
+ ///
+ /// Switches the companies of the merge group in a game to the master company.
+ ///
+ /// game to process
+ ///
public bool UpdateGame(Game game)
{
bool updatedDeveloper = false;
@@ -113,6 +117,9 @@ public bool UpdateGame(Game game)
return updatedDeveloper || updatedPublisher;
}
+ ///
+ /// Cleans up all companies of the merge group.
+ ///
public void CleanUpCompanies()
{
foreach (MergeItem company in Companies.Where(c => c.Merge && c.Id != CompanyId))
@@ -127,6 +134,9 @@ public void CleanUpCompanies()
API.Instance.Database.Companies.Update(masterCompany);
}
+ ///
+ /// Merges this specific group.
+ ///
public RelayCommand MergeGroupCommand
{
get => new RelayCommand(() =>
diff --git a/Generic/CompanyCompanion/ViewModels/MergeItem.cs b/Generic/CompanyCompanion/ViewModels/MergeItem.cs
index f3af3dac4..f0c2a1ecb 100644
--- a/Generic/CompanyCompanion/ViewModels/MergeItem.cs
+++ b/Generic/CompanyCompanion/ViewModels/MergeItem.cs
@@ -12,6 +12,7 @@ namespace CompanyCompanion
public class MergeItem : ViewModelBase
{
private bool merge = true;
+
///
/// Owner of the company. Used to set group name.
///
@@ -32,9 +33,13 @@ public class MergeItem : ViewModelBase
/// Name by which the companies will be grouped.
///
public string GroupName { get; set; }
-
+ ///
+ /// Info about the games from that company (number of games and names of the first 10)
+ ///
public string GameInfo { get; set; }
-
+ ///
+ /// Display name of the company. Includes info for cleaned up name.
+ ///
public string DisplayName
{
get
@@ -74,6 +79,9 @@ public RelayCommand UseAsNameCommand
});
}
+ ///
+ /// Fetches game infos for the company.
+ ///
public void PrepareGameInfo()
{
List gameList = API.Instance.Database.Games
diff --git a/Generic/CompanyCompanion/ViewModels/ViewModelBase.cs b/Generic/CompanyCompanion/ViewModels/ViewModelBase.cs
index 6a971adf0..8338fd607 100644
--- a/Generic/CompanyCompanion/ViewModels/ViewModelBase.cs
+++ b/Generic/CompanyCompanion/ViewModels/ViewModelBase.cs
@@ -2,16 +2,16 @@
namespace CompanyCompanion
{
+ ///
+ /// Base class for the view models
+ ///
public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string propname)
{
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propname));
- }
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propname));
}
}
}
diff --git a/Generic/CompanyCompanion/CompanyCompanionSettingsView.xaml b/Generic/CompanyCompanion/Views/CompanyCompanionSettingsView.xaml
similarity index 100%
rename from Generic/CompanyCompanion/CompanyCompanionSettingsView.xaml
rename to Generic/CompanyCompanion/Views/CompanyCompanionSettingsView.xaml
diff --git a/Generic/CompanyCompanion/CompanyCompanionSettingsView.xaml.cs b/Generic/CompanyCompanion/Views/CompanyCompanionSettingsView.xaml.cs
similarity index 100%
rename from Generic/CompanyCompanion/CompanyCompanionSettingsView.xaml.cs
rename to Generic/CompanyCompanion/Views/CompanyCompanionSettingsView.xaml.cs
diff --git a/Generic/CompanyCompanion/MergeCompaniesView.xaml b/Generic/CompanyCompanion/Views/MergeCompaniesView.xaml
similarity index 100%
rename from Generic/CompanyCompanion/MergeCompaniesView.xaml
rename to Generic/CompanyCompanion/Views/MergeCompaniesView.xaml
diff --git a/Generic/CompanyCompanion/MergeCompaniesView.xaml.cs b/Generic/CompanyCompanion/Views/MergeCompaniesView.xaml.cs
similarity index 94%
rename from Generic/CompanyCompanion/MergeCompaniesView.xaml.cs
rename to Generic/CompanyCompanion/Views/MergeCompaniesView.xaml.cs
index 8c92a039a..03c56fec0 100644
--- a/Generic/CompanyCompanion/MergeCompaniesView.xaml.cs
+++ b/Generic/CompanyCompanion/Views/MergeCompaniesView.xaml.cs
@@ -1,4 +1,5 @@
-using System;
+using KNARZhelper;
+using System;
using System.Windows.Controls;
namespace CompanyCompanion
diff --git a/Generic/CompanyCompanion/extension.yaml b/Generic/CompanyCompanion/extension.yaml
index ef2be942d..94bdab9ed 100644
--- a/Generic/CompanyCompanion/extension.yaml
+++ b/Generic/CompanyCompanion/extension.yaml
@@ -1,7 +1,7 @@
Id: CompanyCompanion_b76edaec-1aa8-48ef-83a4-2a49ab031029
Name: Company Companion
Author: HerrKnarz
-Version: 0.1
+Version: 0.2
Module: CompanyCompanion.dll
Type: GenericPlugin
Icon: icon.png
\ No newline at end of file
diff --git a/Generic/CompanyCompanion/packages.config b/Generic/CompanyCompanion/packages.config
deleted file mode 100644
index c555305c8..000000000
--- a/Generic/CompanyCompanion/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Manifest/HerrKnarz_CompanyCompanion.yaml b/Manifest/HerrKnarz_CompanyCompanion.yaml
new file mode 100644
index 000000000..2813f3ac1
--- /dev/null
+++ b/Manifest/HerrKnarz_CompanyCompanion.yaml
@@ -0,0 +1,8 @@
+AddonId: CompanyCompanion_b76edaec-1aa8-48ef-83a4-2a49ab031029
+Packages:
+ - Version: 0.2
+ RequiredApiVersion: 6.8.0
+ ReleaseDate: 2023-02-27
+ PackageUrl: https://github.com/HerrKnarz/Playnite-Extensions/releases/download/2023-02-27/CompanyCompanion_b76edaec-1aa8-48ef-83a4-2a49ab031029_0_2.pext
+ Changelog:
+ - first official beta release on the addon database
\ No newline at end of file
diff --git a/PlayniteExtensions.sln b/PlayniteExtensions.sln
index 46a0358aa..e8021e9df 100644
--- a/PlayniteExtensions.sln
+++ b/PlayniteExtensions.sln
@@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Manifests", "Manifests", "{4B1654E9-FE08-4523-A69F-D636BF222D32}"
ProjectSection(SolutionItems) = preProject
+ Manifest\HerrKnarz_CompanyCompanion.yaml = Manifest\HerrKnarz_CompanyCompanion.yaml
Manifest\HerrKnarz_LinkUtilities.yaml = Manifest\HerrKnarz_LinkUtilities.yaml
EndProjectSection
EndProject