Пример #1
0
        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;
        }
Пример #2
0
 public static void OnCreating(LocationCreatingEventArgs e)
 {
     EventHandler<LocationCreatingEventArgs> handler = Creating;
     if (handler != null)
     {
         handler(null, e);
     }
 }