public virtual bool Update(ActivityDefinition def) { bool updated = false; if (def == null) { return(false); } if (/*def.Type != null &&*/ !def.type.Equals(this.type)) { this.Type = def.Type; updated = true; } if (def.Name != null && def.Name.Count > 0 && !CommonFunctions.AreDictionariesEqual(this.name, def.name)) { this.name = def.Name; updated = true; } if (def.description != null && def.description.Count > 0 && !CommonFunctions.AreDictionariesEqual(this.description, def.description)) { this.description = def.Description; updated = true; } if (def.InteractionType != null && !def.InteractionType.Equals(this.InteractionType)) { this.InteractionType = def.InteractionType; updated = true; } return(updated); }
public ActivityDefinition(LanguageMap name, LanguageMap description, Uri type, string interactionType) { this.name = name; this.description = description; this.type = type; this.interactionType = interactionType; }
/// <summary> /// Creates a new statement verb given a URI string that is validated and a language map with a single entry /// </summary> /// <param name="id"></param> /// <param name="locale"></param> /// <param name="name"></param> public StatementVerb(string id, string locale, string name) { if (IsUri(id)) { this.id = id; } else { throw new ArgumentException("The URI " + id + " is malformed.", "id"); } display = new LanguageMap(); display[locale] = name; }
/// <summary> /// Creates a Statement Verb from the predefined list of verbs /// </summary> /// <param name="verb"></param> public StatementVerb(PredefinedVerbs verb) { this.id = "http://adlnet.gov/expapi/verbs/" + verb.ToString().ToLower(); this.display = new LanguageMap(); this.display["en-US"] = verb.ToString().ToLower(); }
/// <summary> /// Creates a new statement verb with the provided ID and creates a language map with a single entry /// </summary> /// <param name="id"></param> /// <param name="locale"></param> /// <param name="name"></param> public StatementVerb(Uri id, string locale, string name) { this.id = id.ToString(); display = new LanguageMap(); display[locale] = name; }
/// <summary> /// Creates a new statement verb with the provided ID and Display fields /// </summary> /// <param name="id"></param> /// <param name="display"></param> public StatementVerb(Uri id, LanguageMap display) { this.id = id.ToString(); this.display = display; }