当前位置: 首页>>代码示例>>C#>>正文


C# HookType类代码示例

本文整理汇总了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;
     }
 }
开发者ID:reelgood,项目名称:rg-engine,代码行数:30,代码来源:Hook.cs

示例2: HookBinding

 public HookBinding(IBindingMethod bindingMethod, HookType hookType, BindingScope bindingScope, int hookOrder)
     : base(bindingMethod)
 {
     HookOrder = hookOrder;
     HookType = hookType;
     BindingScope = bindingScope;
 }
开发者ID:wbagit,项目名称:SpecFlow,代码行数:7,代码来源:HookBinding.cs

示例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);
    }
开发者ID:yknD-CM3D2,项目名称:cm3d2_plugins_okiba,代码行数:25,代码来源:PatcherHelper.cs

示例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;
 }
开发者ID:ComposITDevelop,项目名称:SAM,代码行数:14,代码来源:HookEntityMetadata.cs

示例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);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:SerializationCodeGeneratorConfiguration.cs

示例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);
    }
开发者ID:neguse11,项目名称:CM3D2.ShaderWorkbench,代码行数:33,代码来源:PatcherHelper.cs

示例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;
 }
开发者ID:jithuin,项目名称:infogeezer,代码行数:10,代码来源:Hook.cs

示例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;
 }
开发者ID:Wosad,项目名称:Wosad.Design,代码行数:30,代码来源:TensionHookModifiers.cs

示例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();
     }
 }
开发者ID:XtremeKevinChow,项目名称:smartwin32api,代码行数:13,代码来源:BaseHook.cs

示例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);
 }
开发者ID:andyhebear,项目名称:Touch_Hook,代码行数:8,代码来源:WM_TouchHook.cs

示例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);
 }
开发者ID:vchyzhevskyi,项目名称:Statistiks,代码行数:8,代码来源:HookBase.cs

示例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;
 }
开发者ID:andyhebear,项目名称:Touch_Hook,代码行数:8,代码来源:WindowsHook.cs

示例13: GetHookList

        private IEnumerable<IHookBinding> GetHookList(HookType bindingEvent)
        {
            List<IHookBinding> list;
            if (hooks.TryGetValue(bindingEvent, out list))
                return list;

            return Enumerable.Empty<IHookBinding>();
        }
开发者ID:ethanmoffat,项目名称:SpecFlow,代码行数:8,代码来源:BindingRegistry.cs

示例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;
     }
 }
开发者ID:kavengagne,项目名称:WinApiWrapper,代码行数:9,代码来源:HookHandle.cs

示例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);
        }
开发者ID:ethanmoffat,项目名称:SpecFlow,代码行数:9,代码来源:RuntimeBindingSourceProcessor.cs


注:本文中的HookType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。