protected virtual void OnCharacterUpdated(CharacterViewModelProviderEventArgs args) { CharacterProviderDelegate handler = CharacterUpdated; if (handler != null) { handler(this, args); } }
protected virtual void OnCharacterAdded(CharacterViewModelProviderEventArgs args) { _vmCache.Add(args.Model); CharacterProviderDelegate handler = CharacterAdded; if (handler != null) { handler(this, args); } }
protected virtual void OnCharacterUpdated(CharacterViewModelProviderEventArgs args) { CharacterViewModel @char = _vmCache.FirstOrDefault(model => args.OldMetadata.Equals(model.Metadata)); if (@char != null) { @char.Metadata = args.NewMetadata ?? args.OldMetadata; } CharacterProviderDelegate handler = CharacterUpdated; if (handler != null) { handler(this, args); } }