Esempio n. 1
0
        /// <exclude />
        public static ActionToken Deserialize(string serializedData)
        {
            Dictionary<string, string> dic = StringConversionServices.ParseKeyValueCollection(serializedData);

            if (!dic.ContainsKey("_ActionIdentifier_") || !dic.ContainsKey("_PermissionTypes_") )
            {
                throw new ArgumentException($"The {nameof(serializedData)} is not a serialized {nameof(ProxyDataActionToken)}", nameof(serializedData));
            }

            string serializedType = StringConversionServices.DeserializeValueString(dic["_ActionIdentifier_"]);
            
            string permissionTypesString = StringConversionServices.DeserializeValueString(dic["_PermissionTypes_"]);

            var result = new ProxyDataActionToken(ActionIdentifier.Deserialize(serializedType), permissionTypesString.DesrializePermissionTypes());

            return result;
        }
Esempio n. 2
0
        /// <exclude />
        public static ActionToken Deserialize(string serializedData)
        {
            Dictionary <string, string> dic = StringConversionServices.ParseKeyValueCollection(serializedData);

            if (!dic.ContainsKey("_ActionIdentifier_") || !dic.ContainsKey("_PermissionTypes_"))
            {
                throw new ArgumentException($"The {nameof(serializedData)} is not a serialized {nameof(ProxyDataActionToken)}", nameof(serializedData));
            }

            string serializedType = StringConversionServices.DeserializeValueString(dic["_ActionIdentifier_"]);

            string permissionTypesString = StringConversionServices.DeserializeValueString(dic["_PermissionTypes_"]);

            var result = new ProxyDataActionToken(ActionIdentifier.Deserialize(serializedType), permissionTypesString.DesrializePermissionTypes());

            return(result);
        }