public static EventLocation CreateLocation(EventLocation location, int creator) { var db = ApplicationContext.Current.DatabaseContext.Database; var args = new LocationCreatingEventArgs { Location = location }; OnCreating(args); if (args.Cancel) { return(location); } db.Save(location); //Update usersettings and add the newly created calendar to the allowed calendar SecurityService.AddLocationToUser(creator, location.Id); var args2 = new LocationCreatedEventArgs { Location = location }; OnCreated(args2); return(location); }
public static void OnCreated(LocationCreatedEventArgs e) { EventHandler <LocationCreatedEventArgs> handler = Created; if (handler != null) { handler(null, e); } }