Beispiel #1
0
        internal static bool IsUnlocked(ITweakerObject t)
        {
            PublicTweak customAttribute = t.GetCustomAttribute <PublicTweak>();

            if (customAttribute == null)
            {
                return(false);
            }
            return(customAttribute.UnlockTime < DateTime.UtcNow);
        }
Beispiel #2
0
        public static bool IsSet(TweakableUIFlags flag, ITweakerObject tweakable)
        {
            bool result = false;
            TweakableUIFlagsAttribute customAttribute = tweakable.GetCustomAttribute <TweakableUIFlagsAttribute>();

            if (customAttribute != null)
            {
                result = (customAttribute.Flags & flag) == flag;
            }
            return(result);
        }
Beispiel #3
0
        private TreeNode <BaseNode> CreateTweakerNode(TreeNode <BaseNode> parent, ITweakerObject obj)
        {
            BaseNode baseNode = null;

            if (obj is IInvokable)
            {
                baseNode = new InvokableNode(obj as IInvokable);
            }
            else if (obj is ITweakable)
            {
                baseNode = new TweakableNode(obj as ITweakable);
            }
            else if (obj is IWatchable)
            {
                baseNode = new WatchableNode(obj as IWatchable);
            }
            parent.Children.Add(baseNode);
            return(baseNode);
        }
Beispiel #4
0
 public TweakerObjectInvalidException(ITweakerObject obj)
     : base("The invokable named '" + obj.Name + "' is no longer valid and should be unregistered or uncached.")
 {
 }
 public InstanceAlreadyRegisteredException(ITweakerObject obj)
     : base("The instance of type '" + obj.GetType().Name + "' with name '" + obj.Name + "' is already registered.")
 {
 }
 public bool CheckMatch(ITweakerObject obj)
 {
     return(CheckMatch(obj.Name, obj.Assembly, obj.IsPublic ? ScopeType.Public : ScopeType.NonPublic, (obj.WeakInstance != null) ? BindingType.Instance : BindingType.Static, obj.WeakInstance));
 }