Skip to content

Commit

Permalink
不要なファイルを削除した
Browse files Browse the repository at this point in the history
  • Loading branch information
ebifrier committed Jan 24, 2024
1 parent bf65907 commit 7e71f50
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 387 deletions.
65 changes: 0 additions & 65 deletions Ragnarok/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -689,70 +689,5 @@ public static IEnumerable<Assembly> GetCurrentDomainAssembliesType()
{
return AppDomain.CurrentDomain.GetAssemblies();
}

/// <summary>
/// 対象がGC可能な弱い参照を持つイベントハンドラを作成します。
/// </summary>
public static EventHandler MakeWeak(
this EventHandler eventHandler,
UnregisterCallback unregister)
{
if (eventHandler == null)
{
throw new ArgumentNullException(nameof(eventHandler));
}

if (eventHandler.Method.IsStatic || eventHandler.Target == null)
{
// staticメソッドの場合はそのまま返します。
return eventHandler;
}

var wehType = typeof(WeakEventHandler<>).MakeGenericType(
eventHandler.Method.DeclaringType);

var weh = (IWeakEventHandler)Activator.CreateInstance(
wehType,
new object[]
{
eventHandler,
unregister,
});

return weh.Handler;
}

/// <summary>
/// 対象がGC可能な弱い参照を持つイベントハンドラを作成します。
/// </summary>
public static EventHandler<TEventArgs> MakeWeak<TEventArgs>(
this EventHandler<TEventArgs> eventHandler,
UnregisterCallback<TEventArgs> unregister)
where TEventArgs : EventArgs
{
if (eventHandler == null)
{
throw new ArgumentNullException(nameof(eventHandler));
}

if (eventHandler.Method.IsStatic || eventHandler.Target == null)
{
// staticメソッドの場合はそのまま返します。
return eventHandler;
}

var wehType = typeof(WeakEventHandler<,>).MakeGenericType(
eventHandler.Method.DeclaringType, typeof(TEventArgs));

var weh = (IWeakEventHandler<TEventArgs>)Activator.CreateInstance(
wehType,
new object[]
{
eventHandler,
unregister,
});

return weh.Handler;
}
}
}
125 changes: 0 additions & 125 deletions Ragnarok/Utility/DataSegment.cs

This file was deleted.

172 changes: 0 additions & 172 deletions Ragnarok/Utility/WeakEventHandler.cs

This file was deleted.

4 changes: 0 additions & 4 deletions Ragnarok/Utility/weakeventhandler.bat

This file was deleted.

21 changes: 0 additions & 21 deletions Ragnarok/Utility/weakeventhandler.rb

This file was deleted.

0 comments on commit 7e71f50

Please sign in to comment.