SensorbergSDK.Internal.Data.Layout.FromJson C# (CSharp) Метод

FromJson() публичный Метод

Constructs a Layout instance from the given JSON data.
public FromJson ( string headers, DateTimeOffset layoutRetrievedTime ) : void
headers string String repersentation of the header fields.
layoutRetrievedTime DateTimeOffset Timestamp of receiving the layout.
Результат void
        public void FromJson(string headers, DateTimeOffset layoutRetrievedTime)
        {

            try
            {

                if (!string.IsNullOrEmpty(headers))
                {
                    try
                    {
                        ResolveMaxAge(headers, layoutRetrievedTime);
                    }
                    catch (Exception)
                    {
                        ValidTill = DateTimeOffset.MaxValue;
                    }
                }
                else
                {
                    ValidTill = DateTimeOffset.MaxValue;
                }

            } 
            catch (Exception ex)
            {
                Logger.Error("Layout.FromJson(): Failed to parse: " + ex, ex);
            }
        }