本文整理汇总了C#中HookType类的典型用法代码示例。如果您正苦于以下问题:C# HookType类的具体用法?C# HookType怎么用?C# HookType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HookType类属于命名空间,在下文中一共展示了HookType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddMethod
public static void AddMethod(Function func, HookType type)
{
switch (type)
{
case HookType.Update:
UpdateLoop += func;
break;
case HookType.Render:
RenderLoop += func;
break;
case HookType.GUI:
GUILoop += func;
break;
case HookType.FixedUpdate:
FixedUpdateLoop += func;
break;
case HookType.LateUpdate:
LateUpdateLoop += func;
break;
case HookType.PreRender:
PreRenderLoop += func;
break;
case HookType.PostRender:
PostRenderLoop += func;
break;
case HookType.Dispose:
DisposeFunc += func;
break;
}
}
示例2: HookBinding
public HookBinding(IBindingMethod bindingMethod, HookType hookType, BindingScope bindingScope, int hookOrder)
: base(bindingMethod)
{
HookOrder = hookOrder;
HookType = hookType;
BindingScope = bindingScope;
}
示例3: SetHook
public static void SetHook(
HookType hookType,
AssemblyDefinition targetAssembly, string targetName,
AssemblyDefinition calleeAssembly, string calleeName)
{
int i0 = targetName.LastIndexOf('.');
if (i0 < 0)
{
throw new Exception(string.Format("SetHook - Error : Bad Name ({0})", targetName));
}
string targetTypeName = targetName.Substring(0, i0);
string targetMethodName = targetName.Substring(i0 + 1);
int i1 = calleeName.LastIndexOf('.');
if (i1 < 0)
{
throw new Exception(string.Format("SetHook - Error : Bad Name ({0})", calleeName));
}
string calleeTypeName = calleeName.Substring(0, i1);
string calleeMethodName = calleeName.Substring(i1 + 1);
SetHook(hookType,
targetAssembly, targetTypeName, targetMethodName,
calleeAssembly, calleeTypeName, calleeMethodName);
}
示例4: HookEntityMetadata
/// <summary>
/// Initializes a new instance of the <see cref="HookEntityMetadata" /> class.
/// </summary>
/// <param name="hookType"></param>
/// <param name="entry"></param>
/// <param name="state">The state.</param>
/// <param name="context">The optional existing context (I believe this is usable for migrations).</param>
public HookEntityMetadata(HookType hookType, HookedEntityEntry entry, EntityState state, System.Data.Entity.DbContext context = null)
{
HookType = hookType;
Entry = entry;
_state = state;
CurrentContext = context;
}
示例5: GetHooks
public ArrayList GetHooks (HookType hookType, HookDir dir, HookAction action, Type type, string member)
{
if (dir == HookDir.Read)
return FindHook (ReaderHooks, hookType, action, type, member);
else
return FindHook (WriterHooks, hookType, action, type, member);
}
示例6: SetHook
public static void SetHook(
HookType hookType,
AssemblyDefinition targetAssembly, string targetTypeName, string targetMethodName,
AssemblyDefinition calleeAssembly, string calleeTypeName, string calleeMethodName)
{
#if DEBUG
Console.WriteLine("SetHook - {0}/{1}|{2} -> {3}/{4}|{5}", targetAssembly.Name.Name, targetTypeName, targetMethodName, calleeAssembly.Name.Name, calleeTypeName, calleeMethodName);
#endif
TypeDefinition calleeTypeDefinition = calleeAssembly.MainModule.GetType(calleeTypeName);
if (calleeTypeDefinition == null)
{
throw new Exception(string.Format("Error ({0}) : {1} is not found", calleeAssembly.Name, calleeTypeName));
}
MethodDefinition calleeMethod = GetMethod(calleeTypeDefinition, calleeMethodName);
if (calleeMethod == null)
{
throw new Exception(string.Format("Error ({0}) : {1}.{2} is not found", calleeAssembly.Name, calleeTypeName, calleeMethodName));
}
TypeDefinition targetTypeDefinition = targetAssembly.MainModule.GetType(targetTypeName);
if (targetTypeDefinition == null)
{
throw new Exception(string.Format("Error ({0}) : {1} is not found", targetAssembly.Name, targetTypeName));
}
MethodDefinition targetMethod = GetMethod(targetTypeDefinition, targetMethodName);
if (targetMethod == null)
{
throw new Exception(string.Format("Error ({0}) : {1}.{2} is not found", targetAssembly.Name, targetTypeName, targetMethodName));
}
HookMethod(hookType, targetAssembly.MainModule, targetMethod, calleeMethod);
}
示例7: Hook
/// <summary>
/// Creates a new hook.
/// </summary>
public Hook(HookType type, bool wrapCallback, bool global)
: this()
{
this.type = type;
this.wrapCallback = wrapCallback;
this.global = global;
}
示例8: GetConfinementModifier
private double GetConfinementModifier(HookType hookType, bool enclosingRebarIsPerpendicular, double enclosingRebarSpacing)
{
double confinementModifier=1.0;
if (hookType== HookType.Degree90 && db<=11/8)
{
// (b) For 90-degree hooks of No. 11 and smaller bars
// that are either enclosed within ties or stirrups
// perpendicular to the bar being developed, spaced
// not greater than 3db along ldh; or enclosed within
// ties or stirrups parallel to the bar being developed,
// spaced not greater than 3db along the length of the
// tail extension of the hook plus bend.................... 0.8
if (enclosingRebarIsPerpendicular == true && enclosingRebarSpacing <= 3.0 * db)
{
confinementModifier = SetConfinementModifier();
}
if (enclosingRebarIsPerpendicular ==true && enclosingRebarSpacing<3.0*db)
{
confinementModifier = SetConfinementModifier();
}
}
if (hookType== HookType.Degree180 && db<=11/8)
{
if (enclosingRebarIsPerpendicular==true && enclosingRebarSpacing<=3*db)
{
confinementModifier = SetConfinementModifier();
}
}
return confinementModifier;
}
示例9: BaseHook
/// <summary>
/// Initializes a new instance of the <see cref="BaseHook"/> class.
/// </summary>
/// <param name="hookType">Type of the hook.</param>
/// <param name="install">if set to <c>true</c> [install].</param>
internal BaseHook(HookType hookType, bool install)
: this(hookType)
{
if (install)
{
this.Install();
}
}
示例10: WM_TouchHook
public WM_TouchHook(IntPtr hWnd, HookType hookType) : base(hWnd, hookType)
{
this.scalingFactorX = 1f;
this.scalingFactorY = 1f;
DisableNativePressAndHoldGesture = true;
this.mdTouchInputSize = Marshal.SizeOf(new TOUCHINPUT());
this.gestureDelegate = new Win32.WndProcDelegate(this.GestureWndProc);
}
示例11: HookBase
internal HookBase(HookType type)
{
_hType = type;
_hProc = new HookProc(HookProcBase);
using (Process p = Process.GetCurrentProcess())
using (ProcessModule pm = p.MainModule)
_hHook = SetWindowsHookEx((int)_hType, _hProc, GetModuleHandle(pm.ModuleName), 0);
}
示例12: WindowsHook
public WindowsHook(IntPtr hWnd, HookType hook, HookDelegate proc)
{
this.hHook = IntPtr.Zero;
this.hWnd = IntPtr.Zero;
this.hWnd = hWnd;
this.hookType = hook;
this.hookDelegate = proc;
}
示例13: GetHookList
private IEnumerable<IHookBinding> GetHookList(HookType bindingEvent)
{
List<IHookBinding> list;
if (hooks.TryGetValue(bindingEvent, out list))
return list;
return Enumerable.Empty<IHookBinding>();
}
示例14: HookHandle
internal HookHandle(HookType hookType, HookProc hookProc) : base(IntPtr.Zero, false)
{
GCHandle.Alloc(hookProc);
handle = User32.SetWindowsHookEx(hookType, hookProc, IntPtr.Zero, IntPtr.Zero);
if (handle == IntPtr.Zero)
{
IsInvalid = true;
}
}
示例15: ValidateHook
protected override bool ValidateHook(BindingSourceMethod bindingSourceMethod, BindingSourceAttribute hookAttribute, HookType hookType)
{
//TODO: this call will be refactored when binding error detecttion will be improved in v2 - currently implemented here for backwards compatibility
if (!IsScenarioSpecificHook(hookType) &&
!bindingSourceMethod.IsStatic)
throw errorProvider.GetNonStaticEventError(bindingSourceMethod.BindingMethod);
return base.ValidateHook(bindingSourceMethod, hookAttribute, hookType);
}