/// <summary>Set the value of a Vocabulary_Type variable</summary> /// <param name="vocabularyType"></param> /// <param name="value"></param> /// <param name="isClosedVocabulary"></param> /// <param name="link"></param> public static void SetValue(this VocabularyType vocabularyType, string value, bool isClosedVocabulary, string link) { if (value == null) return; if (vocabularyType == null) vocabularyType = new VocabularyType(); vocabularyType.Value = value; vocabularyType.Type = isClosedVocabulary ? VocabularyTypeValueType.ClosedVocabulary : VocabularyTypeValueType.OpenVocabulary; vocabularyType.Link = link; }
/// <summary>Converts a string to a Vocabulary_Type</summary> /// <param name="stringValue"></param> /// <param name="isClosedVocabulary"></param> /// <param name="link"></param> /// <returns></returns> public static VocabularyType ToVocabularyType(this string stringValue, bool isClosedVocabulary, string link) { VocabularyType returnVal = new VocabularyType(); returnVal.SetValue(stringValue, isClosedVocabulary, link); return returnVal; }
/// <remarks/> public void SetCountry(string country) { Country = IMDISchemaHelper.SetVocabulary(country, false, ListType.Link(ListType.Countries)); }
/// <remarks>Closed vocabulary</remarks> public void SetContinent(string continent) { var continentList = ListConstructor.GetClosedList(ListType.Continents, false, ListConstructor.RemoveUnknown.RemoveNone); Continent = continentList.FindByValue(continent).ToVocabularyType(VocabularyTypeValueType.ClosedVocabulary, ListType.Link(ListType.Continents)); }
/// <remarks/> public LocationType() { Continent = new VocabularyType { Type = VocabularyTypeValueType.ClosedVocabulary, Link = ListType.Link(ListType.Continents) }; Country = new VocabularyType { Link = ListType.Link(ListType.Countries) }; Region = new List<string>(); }
/// <remarks/> public void SetSex(string gender) { IMDIItemList genderList = ListConstructor.GetClosedList(ListType.ActorSex); Sex = genderList.FindByValue(gender).ToVocabularyType(VocabularyTypeValueType.ClosedVocabulary, ListType.Link(ListType.ActorSex)); }
/// <remarks/> public void CheckRequiredFields() { if (Genre == null) Genre = new VocabularyType { Link = ListType.Link(ListType.ContentGenre) }; if (SubGenre == null) SubGenre = new VocabularyType { Link = ListType.Link(ListType.ContentSubGenre) }; if (Task == null) Task = new VocabularyType { Link = ListType.Link(ListType.ContentTask) }; if (Modalities == null) Modalities = new VocabularyType { Link = ListType.Link(ListType.ContentModalities) }; if (Subject == null) Subject = new ContentTypeSubject { Link = ListType.Link(ListType.ContentSubject) }; if (CommunicationContext.Interactivity == null) CommunicationContext.Interactivity = new VocabularyType { Type = VocabularyTypeValueType.ClosedVocabulary, Link = ListType.Link(ListType.ContentInteractivity) }; if (CommunicationContext.PlanningType == null) CommunicationContext.PlanningType = new VocabularyType { Type = VocabularyTypeValueType.ClosedVocabulary, Link = ListType.Link(ListType.ContentPlanningType) }; if (CommunicationContext.Involvement == null) CommunicationContext.Involvement = new VocabularyType { Type = VocabularyTypeValueType.ClosedVocabulary, Link = ListType.Link(ListType.ContentInvolvement) }; if (CommunicationContext.SocialContext == null) CommunicationContext.SocialContext = new VocabularyType { Type = VocabularyTypeValueType.ClosedVocabulary, Link = ListType.Link(ListType.ContentSocialContext) }; if (CommunicationContext.EventStructure == null) CommunicationContext.EventStructure = new VocabularyType { Type = VocabularyTypeValueType.ClosedVocabulary, Link = ListType.Link(ListType.ContentEventStructure) }; if (CommunicationContext.Channel == null) CommunicationContext.Channel = new VocabularyType { Type = VocabularyTypeValueType.ClosedVocabulary, Link = ListType.Link(ListType.ContentChannel) }; }