Skip to content

Commit

Permalink
Add More Method for Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Mar 6, 2021
1 parent aedc293 commit f233694
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Compile Include="$(MSBuildThisFileDirectory)HandyControls\Attach\TreeViewAttach.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HandyControls\BindToEnum\EnumBindingSourceExtension.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HandyControls\BindToEnum\EnumDescriptionTypeConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HandyControls\Tools\Collection\RangeObservableCollection.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HandyControls\Tools\Collection\OptimizedObservableCollection.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HandyControls\Tools\Collection\ThreadSafeObservableCollection.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HandyControls\Tools\Collection\ThreadSafe\DispatchedObservableCollection.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HandyControls\Tools\Collection\ThreadSafe\EventArgsCache.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ namespace HandyControl.Controls
/// Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
/// </summary>
/// <typeparam name="T"></typeparam>
public class RangeObservableCollection<T> : ObservableCollection<T>
public class OptimizedObservableCollection<T> : ObservableCollection<T>
{
/// <summary>
/// Initializes a new instance of the System.Collections.ObjectModel.ObservableCollection(Of T) class.
/// </summary>
public RangeObservableCollection()
public OptimizedObservableCollection()
: base()
{
}
Expand All @@ -27,7 +27,7 @@ public RangeObservableCollection()
/// </summary>
/// <param name="collection">collection: The collection from which the elements are copied.</param>
/// <exception cref="System.ArgumentNullException">The collection parameter cannot be null.</exception>
public RangeObservableCollection(IEnumerable<T> collection)
public OptimizedObservableCollection(IEnumerable<T> collection)
: base(collection)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ namespace HandyControl.Tools
{
public class CryptographyHelper
{
[DllImport(InteropValues.ExternDll.Kernel32, EntryPoint = "RtlZeroMemory")]
public static extern bool ZeroMemory(IntPtr Destination, int Length);

public static string GenerateMD5(string input)
{
using MD5 md5 = MD5.Create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,31 @@ public static void Log(string message)
Log(_defaultLevel, message);
}

public static void Error(string message)
{
Log(Level.Error, message);
}

public static void Debug(string message)
{
Log(Level.Debug, message);
}

public static void Fine(string message)
{
Log(Level.Fine, message);
}

public static void Info(string message)
{
Log(Level.Info, message);
}

public static void Warning(string message)
{
Log(Level.Warning, message);
}

public static void Log(Level level, string message)
{
var stackFrame = FindStackFrame();
Expand Down

0 comments on commit f233694

Please sign in to comment.