public virtual void AddCategory(LocationCategory category) { lock ( _categories ) { if (!_categories.ContainsKey(category.Id)) { _categories.Add(category.Id, category); } } //onchange event; }
public virtual void RemoveCategory(LocationCategory category) { lock ( _categories ) { if (_categories.ContainsKey(category.Id)) { _categories.Remove(category.Id); } } //onchange event; }
//public virtual SkyTraxLocation SkyTraxLocation //{ // get // { // return skyTraxLocation; // } // set // { // if ( skyTraxLocation == value ) // return; // skyTraxLocation = value; // // skyTraxLocation.Location = this; // } //} // public virtual LocationCategory Category { get; set; } // public virtual string CategoryName // { // get { return Category.Name ?? "Unknown"; } // set { } // } /// <summary> /// Checks to see if the location is in the category /// </summary> /// <param name="category"></param> /// <returns></returns> public virtual bool IsCategory(LocationCategory category) { return(_categories.ContainsKey(category.Id)); }