-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,806 additions
and
879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Import-Module "d:\_Backup\Configuration\SSL\Tools\app_signModule.ps1" -Force | ||
|
||
[string[]]$appFiles = @( | ||
"..\bin\Release\publish\JocysCom.FocusLogger.exe", | ||
) | ||
[string]$appName = "Jocys.com Focus Logger" | ||
[string]$appLink = "https://www.jocys.com" | ||
|
||
ProcessFiles $appName $appLink $appFiles | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@ECHO off | ||
SET wra="%ProgramFiles%\WinRAR\winrar.exe" | ||
IF NOT EXIST %wra% SET wra="%ProgramFiles(x86)%\WinRAR\winrar.exe" | ||
IF NOT EXIST %wra% SET wra="%ProgramW6432%\WinRAR\winrar.exe" | ||
IF NOT EXIST %wra% SET wra="D:\Program Files\WinRAR\winrar.exe" | ||
SET zip=%wra% a -ep | ||
:: --------------------------------------------------------------------------- | ||
IF NOT EXIST Files\nul MKDIR Files | ||
::------------------------------------------------------------- | ||
:: Archive Files | ||
CALL:CRE Files JocysCom.FocusLogger.exe .exe | ||
ECHO. | ||
pause | ||
GOTO:EOF | ||
|
||
::------------------------------------------------------------- | ||
:CRE :: Archive | ||
::------------------------------------------------------------- | ||
SET src=%~1 | ||
SET arc=Files\%~2.zip | ||
ECHO. | ||
IF NOT EXIST "%src%\%~2%~3" ( | ||
ECHO "%src%\%~2%~3" not exist. Skipping. | ||
GOTO:EOF | ||
) | ||
ECHO Creating: %arc% | ||
:: Create Archive. | ||
IF EXIST %arc% DEL %arc% | ||
%zip% %arc% %src%\%~2%~3 | ||
GOTO:EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace JocysCom.ClassLibrary.Collections | ||
{ | ||
public static partial class CollectionsHelper | ||
{ | ||
|
||
/// <summary> | ||
/// Synchronize source collection to destination. | ||
/// </summary> | ||
public static void Synchronize<T>(IList<T> source, IList<T> target, IEqualityComparer<T> comparer = null) | ||
{ | ||
comparer = comparer ?? EqualityComparer<T>.Default; | ||
// Create a dictionary for fast lookup in source list | ||
var sourceSet = new Dictionary<T, int>(); | ||
for (int i = 0; i < source.Count; i++) | ||
sourceSet[source[i]] = i; | ||
// Iterate over the target, remove items not in source | ||
for (int i = target.Count - 1; i >= 0; i--) | ||
if (!sourceSet.Keys.Contains(target[i], comparer)) | ||
target.RemoveAt(i); | ||
// Iterate over source | ||
for (int si = 0; si < source.Count; si++) | ||
{ | ||
// If item is not present in target, insert it. | ||
// Note: Only check items that have not been synchornized in the target. | ||
if (!target.Skip(si).Contains(source[si], comparer)) | ||
{ | ||
target.Insert(si, source[si]); | ||
continue; | ||
} | ||
// If item is present in target but not at the right position, move it. | ||
int ti = -1; | ||
// Note: Only check items that have not been synchornized in the target. | ||
for (int i = si; i < target.Count; i++) | ||
{ | ||
if (comparer.Equals(target[i], source[si])) | ||
{ | ||
ti = i; | ||
break; | ||
} | ||
} | ||
if (ti != si) | ||
{ | ||
T temp = target[si]; | ||
target[si] = target[ti]; | ||
target[ti] = temp; | ||
} | ||
} | ||
// Remove items at the end of target that exceed source's length | ||
while (target.Count > source.Count) | ||
target.RemoveAt(target.Count - 1); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
|
||
namespace JocysCom.ClassLibrary.Configuration | ||
{ | ||
public interface ISettingsItemFile | ||
{ | ||
/// <summary> | ||
/// Map to property which contains base file name. | ||
/// </summary> | ||
string BaseName { get; set; } | ||
|
||
/// <summary> | ||
/// Map to property which contains last time item was modified. | ||
/// Update on INotifyPropertyChanged. | ||
/// </summary> | ||
DateTime WriteTime { get; set; } | ||
|
||
/* Example: | ||
#region ■ ISettingsItemFile | ||
[XmlIgnore] | ||
string ISettingsItemFile.BaseName { get => Name; set => Name = value; } | ||
[XmlIgnore] | ||
DateTime ISettingsItemFile.WriteTime { get; set; } | ||
#endregion | ||
protected void OnPropertyChanged([CallerMemberName] string propertyName = null) | ||
{ | ||
((ISettingsItemFile)this).WriteTime = DateTime.Now; | ||
} | ||
*/ | ||
|
||
} | ||
} | ||
|
Oops, something went wrong.