本文整理汇总了C#中HookType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# HookType.ToString方法的具体用法?C# HookType.ToString怎么用?C# HookType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HookType
的用法示例。
在下文中一共展示了HookType.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetHookValue
public static bool SetHookValue(HookType type, int index, Composite value, bool insert = false)
{
if (!TreeHooks.Instance.Hooks.ContainsKey(type.ToString())) return false;
if (!insert)
{
TreeHooks.Instance.Hooks[type.ToString()][index] = value;
Logger.DBLog.DebugFormat("Replaced Hook [{0}]", type.ToString());
return true;
}
else
{
TreeHooks.Instance.Hooks[type.ToString()].Insert(index, value);
Logger.DBLog.DebugFormat("Inserted composite for Hook [{0}] at index {1}", type.ToString(), index);
return true;
}
}
示例2: RestoreHook
public static void RestoreHook(HookType type)
{
if (OriginalHooks.ContainsKey(type))
{
if (!TreeHooks.Instance.Hooks.ContainsKey(type.ToString()))
{
Logger.DBLog.DebugFormat("Adding Original Hook [{0}]", type.ToString());
TreeHooks.Instance.Hooks.Add(type.ToString(), OriginalHooks[type]);
}
else
{
Logger.DBLog.DebugFormat("Restoring Original Hook [{0}]", type.ToString());
TreeHooks.Instance.Hooks[type.ToString()].Clear();
for (int i = 0; i < OriginalHooks[type].Count; i++)
{
var composite = OriginalHooks[type][i];
TreeHooks.Instance.Hooks[type.ToString()].Add(composite);
}
}
OriginalHooks.Remove(type);
}
}
示例3: StoreHook
public static void StoreHook(HookType type)
{
if (!OriginalHooks.ContainsKey(type))
{
List<Composite> newList = new List<Composite>();
var Startcomposite = TreeHooks.Instance.Hooks[type.ToString()][0];
newList.Add(Startcomposite);
if (TreeHooks.Instance.Hooks[type.ToString()].Count>1)
{
for (int i = 1; i < TreeHooks.Instance.Hooks[type.ToString()].Count; i++)
{
var additionalComposite = TreeHooks.Instance.Hooks[type.ToString()][i];
newList.Add(additionalComposite);
}
}
OriginalHooks.Add(type, newList);
Logger.DBLog.DebugFormat("Stored Hook [{0}] with {1} composite(s)", type.ToString(), newList.Count);
}
}
示例4: ReturnHookValue
public static List<Composite> ReturnHookValue(HookType type)
{
return TreeHooks.Instance.Hooks[type.ToString()];
}