Example #1
0
        internal void SetMethodRetValue(int callMethodRequestId, string methodName, JToken methodRetValueJson)
        {
            if (!HandledMethods.ContainsKey(methodName))
            {
                return;
            }

            Type   methodRetType = GetMethodReturnType(methodName);
            object methodRet     = MyAngularUi.ParseMauDataFromFrontEnd(methodRetType, methodRetValueJson);

            // Make valid enum value
            MauEnumMemberAttribute.GetValidEnumValue(methodRetType, ref methodRet);

            MyAngularUi.OrdersResponse.TryAdd(callMethodRequestId, methodRet);
        }
Example #2
0
        internal void SetPropValue(string propName, JToken propValueJson)
        {
            if (!HandledProps.ContainsKey(propName))
            {
                return;
            }

            Type   propValType = GetPropType(propName);
            object propValue   = MyAngularUi.ParseMauDataFromFrontEnd(propValType, propValueJson);

            // Make valid enum value
            MauEnumMemberAttribute.GetValidEnumValue(propValType, ref propValue);

            // Deadlock will not happen because of 'HandledProps[propName].HandleOnSet'
            lock (HandledProps[propName])
                HandledProps[propName].DoWithoutHandling(p => p.Holder.SetValue(this, propValue));
        }