public void AddStandard(LuaFuncStandard standard)
 {
     Standards.Add(standard);
 }
예제 #2
0
        /// <summary>
        ///     Deserialize the object
        /// </summary>
        public virtual void DeserializeJson(JToken inputObject)
        {
            if (inputObject != null && inputObject.Type != JTokenType.Null)
            {
                var idValue = inputObject["id"];
                if (idValue != null && idValue.Type != JTokenType.Null)
                {
                    Id = int.Parse((string)idValue);
                }

                var emailValue = inputObject["email"];
                if (emailValue != null && emailValue.Type != JTokenType.Null)
                {
                    Email = (string)emailValue;
                }

                var employerSatisfactionValue = inputObject["employerSatisfaction"];
                if (employerSatisfactionValue != null && employerSatisfactionValue.Type != JTokenType.Null)
                {
                    EmployerSatisfaction = (double)employerSatisfactionValue;
                }

                var frameworksSequence = inputObject["frameworks"];
                if (frameworksSequence != null && frameworksSequence.Type != JTokenType.Null)
                {
                    foreach (var frameworksValue in (JArray)frameworksSequence)
                    {
                        var framework = new Framework();
                        framework.DeserializeJson(frameworksValue);
                        Frameworks.Add(framework);
                    }
                }

                var learnerSatisfactionValue = inputObject["learnerSatisfaction"];
                if (learnerSatisfactionValue != null && learnerSatisfactionValue.Type != JTokenType.Null)
                {
                    LearnerSatisfaction = (double)learnerSatisfactionValue;
                }

                var locationsSequence = inputObject["locations"];
                if (locationsSequence != null && locationsSequence.Type != JTokenType.Null)
                {
                    foreach (var locationsValue in (JArray)locationsSequence)
                    {
                        var location = new Location();
                        location.DeserializeJson(locationsValue);
                        Locations.Add(location);
                    }
                }

                var marketingInfoValue = inputObject["marketingInfo"];
                if (marketingInfoValue != null && marketingInfoValue.Type != JTokenType.Null)
                {
                    MarketingInfo = (string)marketingInfoValue;
                }

                var nameValue = inputObject["name"];
                if (nameValue != null && nameValue.Type != JTokenType.Null)
                {
                    Name = (string)nameValue;
                }

                var nationalProviderValue = inputObject["nationalProvider"];
                if (nationalProviderValue != null && nationalProviderValue.Type != JTokenType.Null)
                {
                    NationalProvider = (bool)nationalProviderValue;
                }

                var phoneValue = inputObject["phone"];
                if (phoneValue != null && phoneValue.Type != JTokenType.Null)
                {
                    Phone = (string)phoneValue;
                }

                var standardsSequence = inputObject["standards"];
                if (standardsSequence != null && standardsSequence.Type != JTokenType.Null)
                {
                    foreach (var standardsValue in (JArray)standardsSequence)
                    {
                        var standard = new Standard();
                        standard.DeserializeJson(standardsValue);
                        Standards.Add(standard);
                    }
                }

                var ukprnValue = inputObject["ukprn"];
                if (ukprnValue != null && ukprnValue.Type != JTokenType.Null)
                {
                    Ukprn = (int)ukprnValue;
                }

                var websiteValue = inputObject["website"];
                if (websiteValue != null && websiteValue.Type != JTokenType.Null)
                {
                    Website = (string)websiteValue;
                }
            }
        }
 public void AddStandard(string path, bool isCoroutine = false, bool autoResetCoroutine = false)
 {
     Standards.Add(new LuaFuncStandard(path, isCoroutine, autoResetCoroutine));
 }