public IAction CreateNewCopy()
        {
            MethodAction a = (MethodAction)Activator.CreateInstance(this.GetType(), Owner);

            a.MemberId    = (UInt32)(Guid.NewGuid().GetHashCode());
            a.Description = this.Description;
            if (string.IsNullOrEmpty(MethodName))
            {
                a.MethodName = "Action" + Guid.NewGuid().GetHashCode().ToString("x");
            }
            else
            {
                if (MethodName.Length > 30)
                {
                    a.MethodName = MethodName.Substring(0, 30) + Guid.NewGuid().GetHashCode().ToString("x");
                }
                else
                {
                    a.MethodName = MethodName + "_" + Guid.NewGuid().GetHashCode().ToString("x");
                }
            }
            if (_returnReceiver != null)
            {
                a._returnReceiver = (IObjectPointer)_returnReceiver.Clone();
            }
            if (_condition != null)
            {
                a._condition = (ExpressionValue)_condition.Clone();
            }
            return(a);
        }
        public bool IsSameMethod(IAction act)
        {
            MethodAction m = act as MethodAction;

            if (m != null)
            {
                return(m.MemberId == this.MemberId);
            }
            return(false);
        }
        public bool IsSameObjectRef(IObjectIdentity objectIdentity)
        {
            MethodAction m = objectIdentity as MethodAction;

            if (m != null)
            {
                return(_method.IsSameMethod(m));
            }
            MethodActionPointer mp = objectIdentity as MethodActionPointer;

            if (mp != null)
            {
                return(_method.IsSameMethod(mp.MethodPointed));
            }
            return(false);
        }
        public bool IsSameMethod(IMethod method)
        {
            MethodAction m = method as MethodAction;

            if (m != null)
            {
                return(_method.IsSameMethod(m));
            }
            MethodActionPointer mp = method as MethodActionPointer;

            if (mp != null)
            {
                return(_method.IsSameMethod(mp.MethodPointed));
            }
            return(false);
        }
 public MethodActionPointer(MethodAction method)
 {
     _method = method;
 }