public override ICatchable WhenCatched(IHook hook) { this.MoveBehaviour.StopMove (); Explode(); return null; }
public async void HookedDbContext_MustCallHooks_WhenRunningSaveChangesAsync() { var hooks = new IHook[] { new TimestampPreInsertHook() }; var context = new LocalContext(hooks); var entity = new TimestampedSoftDeletedEntity(); context.Entities.Add(entity); await context.SaveChangesAsync(); Assert.AreEqual(entity.CreatedAt.Date, DateTime.Today); }
public virtual bool CanConnect(IHook one, IHook two) { return(HookType.IsInstanceOfType(one) && HookType.IsInstanceOfType(two)); }
// Constructor public CutsceneTracker() { _moviePlayHook = MoviePlay.Fun_Play.Hook(MoviePlayImpl).Activate(); _movieEndHook = MoviePlay.Fun_End.Hook(MovieEndImpl).Activate(); }
public virtual ICatchable WhenCatched(IHook hook) { return this; }
private void AttachHooks(IHook[] hooks) { if (hooks == null) { InitializeHooks(); return; }; PreHooks = hooks.OfType<IPreActionHook>().ToList(); PostHooks = hooks.OfType<IPostActionHook>().ToList(); PostLoadHooks = hooks.OfType<IPostLoadHook>().ToList(); }
public TestEventPublisher(IEventPublisher eventPublisher, IHook <object> hook) { _eventPublisher = eventPublisher; _hook = hook; }
/// <summary> /// Initializes a new instance of the <see cref="HookedDbContext" /> class, using the specified <paramref name="nameOrConnectionString"/>, , filling <see cref="_hooks"/> and <see cref="_hooks"/>. /// </summary> /// <param name="hooks">The hooks.</param> /// <param name="nameOrConnectionString">The name or connection string.</param> public HookedDbContext(IHook[] hooks, string nameOrConnectionString) : base(nameOrConnectionString) { _hooks = hooks.Select(h => new HookDecorator { Hook = h }).ToList(); }
public DefaultSettingsHook(DefaultSettings defaultSettings, IReloadedHooks hooks) { DefaultSettings = defaultSettings; ReadConfigFromIniHook = hooks.CreateHook <ReadConfigfromINI>(ReadConfigFromIni, 0x00629CE0).Activate(); }
public static void AddHook(IHook hook) { DeductionHooks[hook.HookedSymbol] = hook; }
public Detour(IHook hook, Delegate targetDelegate) { _hook = hook; _targetDelegate = targetDelegate; }
public LocalContext(IHook[] hooks) : base(hooks) { }
void before_each() { _subject = new SubjectToHook(); _notToBeGCed = Hook; _hook = CreateHook(new InProcessMemory(), _subject.ManagedPointer, Marshal.GetFunctionPointerForDelegate(_notToBeGCed)); }
// Use this for initialization void Start() { // Устанавливаем крючок, в соответствии с заданной позицией if (Mathf.Approximately (this.length, 0.0f)) { // Если длина крючка равна 0, то используем расположение, заданное в редакторе this.length = Vector3.Distance(this.fishingHookPivotPoint.transform.position, this.fishingHookCenterOfRotation.transform.position); } else { if (this.length < 0) { this.length = SimpleSpinning.lengthByDefault; } this.fishingHookPivotPoint.transform.position = new Vector3 ( this.fishingHookCenterOfRotation.transform.position.x, this.fishingHookCenterOfRotation.transform.position.y - this.length, // минус, потому что крючок направлен вниз this.fishingHookCenterOfRotation.transform.position.z ); } if (this.maxLength <= this.length) { this.maxLength = SimpleSpinning.maxLengthByDefault; } if (this.angleSpeed <= 0) { this.angleSpeed = SimpleSpinning.angleSpeedByDefault; } if (this.maxAngleDeviation < 0.0f || this.maxAngleDeviation > 90.0f) { this.maxAngleDeviation = SimpleSpinning.maxAngleDeviationByDefault; } if (this.catchSpeed < 0) { this.catchSpeed = SimpleSpinning.catchSpeedByDefault; } this.directionHookMove = DirectionHookMove.nowhere; this.fishingHook = this.fishingHookGameObject.GetComponent<IHook> (); this.fishingHook.SetOwner (this); this.fishingHook.OnCatchStaff += (ICatchable obj) => { this.catchedStuff = obj; this.ChangeState(SpinningState.PullStuff); }; }
/// <summary> /// Initializes a new instance of the <see cref="HookedDbContext" /> class using the an existing connection to connect /// to a database. The connection will not be disposed when the context is disposed. (see <see cref="DbContext"/> overloaded constructor) /// </summary> /// <param name="hooks">The hooks.</param> /// <param name="existingConnection">An existing connection to use for the new context.</param> /// <param name="contextOwnsConnection">If set to true the connection is disposed when the context is disposed, otherwise the caller must dispose the connection.</param> /// <remarks>Main reason for allowing this, is to enable reusing another database connection. (For instance one that is profiled by Miniprofiler (http://miniprofiler.com/)).</remarks> public HookedDbContext(IHook[] hooks, DbConnection existingConnection, bool contextOwnsConnection) : base(existingConnection, contextOwnsConnection) { PreHooks = hooks.OfType<IPreActionHook>().ToList(); PostHooks = hooks.OfType<IPostActionHook>().ToList(); }
public override void Execute(DrawTheory theory, IEnumerable <IFunctionInstance> arguments, IEnumerable <IAtom> body) { IHook hook = this.ExecuteResult(theory, arguments, body) as IHook; theory.AddHook(hook); }
public int GetHookIndex(IHook hook) => allHooks.IndexOf(hook);
public HookedDbContext(IHook[] hooks) { PreHooks = hooks.OfType<IPreActionHook>().ToList(); PostHooks = hooks.OfType<IPostActionHook>().ToList(); }
/// <summary> /// Registers a hook /// </summary> /// <param name="hook">The hook to register.</param> /// <param name="order">Optional ordering to run the hook in</param> public void RegisterHook(IHook hook, Int32? order = null) { _hooks.Add(new HookDecorator { Hook = hook, Order = order }); }
public HookedDbContext(IHook[] hooks, string nameOrConnectionString) : base(nameOrConnectionString) { PreHooks = hooks.OfType<IPreActionHook>().ToList(); PostHooks = hooks.OfType<IPostActionHook>().ToList(); }
/// <summary> /// Hooks the game Draw HUD function /// </summary> static Queue() { DrawHudHook = new Hook <DrawHUD>(DrawHudHookImpl, DrawHudAddress); DrawHudHook.Activate(); }
public StageLoadCrashFixHook() { _cameraInitHook = new Hook <TObjCamera_Init>(TObjCameraInit, 0x0061D3B0).Activate(); }
public void RemoveController(IHook controller) { ControllerList.Remove(controller); }
/// <summary> /// Initializes a new instance of the <see cref="HookedDbContext" /> class, using the specified <paramref name="nameOrConnectionString"/>, , filling <see cref="PreHooks"/> and <see cref="PostHooks"/>. /// </summary> /// <param name="hooks">The hooks.</param> /// <param name="nameOrConnectionString">The name or connection string.</param> public HookedDbContext(IHook[] hooks, string nameOrConnectionString) : base(nameOrConnectionString) { AttachHooks(hooks); ListenToObjectMaterialized(); }
/// <inheritdoc cref="IHook.Install(long, bool)"/> /// <param name="hook">Hook to be installed.</param> /// <param name="process">Target process.</param> public static void Install(this IHook hook, Process process, bool ignoreProcessHasNoWindow = false) => hook.Install(process.Id, ignoreProcessHasNoWindow);
public TestScheduledCommandPublisher(IScheduledCommandPublisher messageSession, IHook <object> hook) { _messageSession = messageSession; _hook = hook; }
/// <inheritdoc cref="IHook.Combine(IEnumerable{IHook})"/> public static IHook Combine(this IEnumerable <IHook> hooks) => IHook.Combine(hooks);
public void AddHook(IHook hook) { this.hooks.Add(hook); }
// Constructor public VictoryCounter() { _tObjTeamExecHook = TObjTeam.Fun_Exec.Hook(CheckScoreIncrementHookFunction).Activate(); }
public virtual void Init(IHook hook) { _hook = hook; }
public void SetHook(IHook hook) { _hook = hook; }
public DefaultSettingsHook(DefaultSettings defaultSettings) { DefaultSettings = defaultSettings; ReadConfigFromIniHook = Fun_ReadConfigfromINI.Hook(ReadConfigFromIni).Activate(); }
void RegisterHook(IHook hook) { hook.OnRegister(this); Harmony.CreateAndPatchAll(hook.GetType()); hooks.Add(hook); }
public void Register(IHook hook) { hooks.Add(hook); }
/// <summary> /// Initializes the hook class. /// </summary> private void SetupHook(WndProc proc, IntPtr address) { HookFunction = proc; Hook = SDK.Hooks.CreateHook <WndProc>(HookFunction, (long)address).Activate(); }
/// <summary> /// Registers a hook. /// </summary> /// <param name="hook">The hook to register.</param> public void Add(IHook hook) { RegisterHook(hook as IPreActionHook); RegisterHook(hook as IPostActionHook); }
public void AddController(IHook controller) { if (!ControllerList.Contains(controller)) ControllerList.Add(controller); }
/// <summary> /// Initializes a new instance of the <see cref="HookedDbContext" /> class, filling <see cref="_hooks"/> and <see cref="_hooks"/>. /// </summary> /// <param name="hooks">The hooks.</param> public HookedDbContext(IHook[] hooks) { _hooks = hooks.Select(h => new HookDecorator { Hook = h }).ToList(); }
/// <summary> /// Initializes a new instance of the <see cref="HookedDbContext" /> class using the an existing connection to connect /// to a database. The connection will not be disposed when the context is disposed. (see <see cref="DbContext"/> overloaded constructor) /// </summary> /// <param name="hooks">The hooks.</param> /// <param name="existingConnection">An existing connection to use for the new context.</param> /// <param name="contextOwnsConnection">If set to true the connection is disposed when the context is disposed, otherwise the caller must dispose the connection.</param> /// <remarks>Main reason for allowing this, is to enable reusing another database connection. (For instance one that is profiled by Miniprofiler (http://miniprofiler.com/)).</remarks> public HookedDbContext(IHook[] hooks, DbConnection existingConnection, bool contextOwnsConnection) : base(existingConnection, contextOwnsConnection) { _hooks = hooks.Select(h => new HookDecorator { Hook = h }).ToList(); }
public ClippingPlanesHook(float aspectLimit) { AspectRatioLimit = aspectLimit; BuildClipPlanesHook = Fun_CameraBuildPerspClipPlanes.Hook(BuildClipPlanesImpl).Activate(); }
public AspectRatioHook(float aspectRatioLimit) { AspectRatioLimit = aspectRatioLimit; SetViewWindowHook = Fun_RwCameraSetViewWindow.Hook(SetViewWindowImpl).Activate(); }
public DefaultSettingsHook(DefaultSettings defaultSettings) { DefaultSettings = defaultSettings; ReadConfigFromIniHook = new Hook <ReadConfigfromINI>(ReadConfigFromIni, 0x00629CE0).Activate(); }
public TestCommandDispatcher(ICommandDispatcher commandDispatcher, IHook <ICommand> hook) { _commandDispatcher = commandDispatcher; _hook = hook; }
/// <inheritdoc/> public abstract bool TryCreate(T instance, out IHook <T> hook);
/// <summary> /// Initializes a new instance of the <see cref="HookedDbContext" /> class using the an existing connection to connect /// to a database. The connection will not be disposed when the context is disposed. (see <see cref="DbContext"/> overloaded constructor) /// </summary> /// <param name="hooks">The hooks.</param> /// <param name="existingConnection">An existing connection to use for the new context.</param> /// <param name="contextOwnsConnection">If set to true the connection is disposed when the context is disposed, otherwise the caller must dispose the connection.</param> /// <remarks>Main reason for allowing this, is to enable reusing another database connection. (For instance one that is profiled by Miniprofiler (http://miniprofiler.com/)).</remarks> public HookedDbContext(IHook[] hooks, DbConnection existingConnection, bool contextOwnsConnection) : base(existingConnection, contextOwnsConnection) { AttachHooks(hooks); ListenToObjectMaterialized(); }
public unsafe DrawDistanceHook(Config config, IReloadedHooks hooks, IReloadedHooksUtilities utilities) { _config = config; _optimizeHook = hooks.CreateHook <SetParamOptimize>(ModifyObjectDistance, 0x0043DF40).Activate(); }
/// <summary> /// Initializes a new instance of the <see cref="HookedDbContext" /> class, filling <see cref="PreHooks"/> and <see cref="PostHooks"/>. /// </summary> /// <param name="hooks">The hooks.</param> public HookedDbContext(IHook[] hooks) : base() { AttachHooks(hooks); ListenToObjectMaterialized(); }
public virtual void OnCreate(object Hook) { this.m_Hook = Hook as IHook; }
public static bool IsConnectedTo(this IHook hook, IHook other) { return(hook.Connections.Exists(x => x.From == other || x.To == other)); }