public void Deserialize(string content) { // make sure that the parameter starts with RESOURCES if (!content.ToUpper().StartsWith(Markup)) { throw new ArgumentException($"Invalid resources detected! Component property needs to start with { Markup } keyword!"); } // deserialize parameters Parameters = content.Substring(Markup.Length, content.IndexOf(':') - Markup.Length) .Split(';', StringSplitOptions.RemoveEmptyEntries) .Select(x => CalendarFactory.DeserializePropertyParameter(x)) .ToList(); // extract the value content string valueContent = content.Substring(content.IndexOf(':') + 1).Trim(); Resources = ObjectSerializer.Deserialize <TextListValue>(valueContent); // make sure that the language parameter only occurs once if (Parameters.Where(x => x.GetType() == typeof(LanguageParameter)).Count() > 1) { throw new ArgumentException("Invalid parameter detected! Language parameter needs to be unique!"); } if (Parameters.Where(x => x.GetType() == typeof(AlternateTextRepresentationParamter)).Count() > 1) { throw new ArgumentException("Invalid parameter detected! AlternateTextRepresentation parameter needs to be unique!"); } }
public ResourcesProperty(TextListValue resources, IEnumerable <IPropertyParameter> parameters) { Resources = resources; Parameters = parameters; }
public CategoriesProperty(TextListValue categories, IEnumerable <IPropertyParameter> parameters) { Categories = categories; Parameters = parameters; }
public ResourcesProperty(TextListValue resources) { Resources = resources; }
public CategoriesProperty(TextListValue categories) { Categories = categories; }