コード例 #1
0
        public override void Process(uint when, object _)
        {
            if (patches.TryGetValue(when, out PrivateRunList atTime) && atTime != null &&
                atTime.Count > 0)
            {
                string stage = RunAt.ToString(when);
#if DEBUG
                PRegistry.LogPatchDebug("Executing {0:D} handler(s) from {1} for stage {2}".F(
                                            atTime.Count, Assembly.GetExecutingAssembly().GetNameSafe() ?? "?", stage));
#endif
                foreach (var patch in atTime)
                {
                    try {
                        patch.Run(harmony);
                    } catch (TargetInvocationException e) {
                        // Use the inner exception
                        PUtil.LogError("Error running patches for stage " + stage + ":");
                        PUtil.LogException(e.GetBaseException());
                    }
                }
コード例 #2
0
 public override string ToString()
 {
     return("PLibMethod[RunAt={0}]".F(RunAt.ToString(Runtime)));
 }
コード例 #3
0
 public override string ToString()
 {
     return("PLibPatch[RunAt={0},PatchType={1},MethodName={2}]".F(RunAt.ToString(
                                                                      Runtime), PatchType, MethodName));
 }