Ejemplo n.º 1
0
        void IJsonDeserializable.ReadProperties(JsonElement json)
        {
            foreach (JsonProperty prop in json.EnumerateObject())
            {
                switch (prop.Name)
                {
                case KeyPropsPropertyName:
                    ReadKeyProperties(prop.Value);
                    break;

                case SecretPropsPropertyName:
                    ReadSecretProperties(prop.Value);
                    break;

                case X509PropsPropertyName:
                    ReadX509CertificateProperties(prop.Value);
                    break;

                case IssuerPropertyName:
                    ReadIssuerProperties(prop.Value);
                    break;

                case AttributesPropertyName:
                    ReadAttributesProperties(prop.Value);
                    break;

                case LifetimeActionsPropertyName:
                    foreach (JsonElement actionElem in prop.Value.EnumerateArray())
                    {
                        LifetimeActions.Add(LifetimeAction.FromJsonObject(actionElem));
                    }
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        internal static LifetimeAction FromJsonObject(JsonElement json)
        {
            var action = new LifetimeAction();

            ((IJsonDeserializable)action).ReadProperties(json);

            return(action);
        }