示例#1
0
        internal void Update(ExtendedMemberInfo model)
        {
            Update(model as API.MemberInfo);

            if (model.IsServerDeafened != null)
            {
                IsServerDeafened = model.IsServerDeafened.Value;
            }
            if (model.IsServerMuted != null)
            {
                IsServerMuted = model.IsServerMuted.Value;
            }
        }
示例#2
0
        /// <summary>
        /// Creates a new <see cref="MethodContext"/> instance.
        /// </summary>
        /// <remarks>Calling this constructor is time consuming operation. It is strongly advised to cache the created instances.</remarks>
        public MethodContext(Func <object, object?[], object?> dispatch)
        {
            if (dispatch is null)
            {
                throw new ArgumentNullException(nameof(dispatch));
            }

            ExtendedMemberInfo memberInfo = MemberInfoExtensions.ExtractFrom(dispatch);

            Member   = memberInfo.Member;
            Method   = memberInfo.Method;
            Dispatch = dispatch;
        }