/// <summary> /// Checks whether the file is allowed to be used as an avatar /// </summary> /// <param name="postedFile">A posted image file</param> public static bool IsFileAllowed(this IAvatarsService service, HttpPostedFileBase postedFile) { if (postedFile == null) { return(false); } return(service.IsFileAllowed(postedFile.FileName)); }
public RocketChatRestApi( IToastNotificationsService toastService, IAvatarsService avatarsService, IEventAggregator eventAggregator) { this.toastService = toastService; this.avatarsService = avatarsService; this.eventAggregator = eventAggregator; this.eventAggregator.GetEvent <ServerAddressChangedEvent>().Subscribe(ServerAddressChangedHandler); GetServerAddress(); }
public AvatarPartHandler( IAvatarsService avatarsService) { _avatarsService = avatarsService; OnLoaded<AvatarPart>((context, part) => { // Add loaders that will load content just-in-time part.ImageUrlField.Loader(() => _avatarsService.GetAvatarUrl(part.As<CommonPart>().Owner.Id)); }); }
public AvatarProfilePartHandler( IRepository<AvatarProfilePartRecord> repository, IAvatarsService avatarsService) { Filters.Add(StorageFilter.For(repository)); _avatarsService = avatarsService; OnLoaded<AvatarProfilePart>((context, part) => { // Add loaders that will load content just-in-time part.ImageUrlField.Loader(() => _avatarsService.GetAvatarUrl(part.Id)); }); }
public AvatarsEventHandler(IAvatarsService avatarsService) { _avatarsService = avatarsService; Logger = NullLogger.Instance; }
public AvatarProfilePartDriver(IAvatarsService avatarsService) { _avatarsService = avatarsService; }
public Migrations(IAvatarsService avatarsService) { _avatarsService = avatarsService; }
public void Init() { this.users = TestObjectFactory.Users; this.avatarsService = TestObjectFactory.GetAvatarsService(); this.avatarController = new AvatarsController(this.avatarsService); }
public Migrations(IAvatarsService avatarsService, IStorageProvider storageProvider) { _avatarsService = avatarsService; _storageProvider = storageProvider; }
public AvatarsController(IAvatarsService avatars) { this.avatarsService = avatars; }
public AvatarsController(IAvatarsService avatarServicePassed) { this.avatars = avatarServicePassed; }
/// <summary> /// Saves an avatar file /// </summary> /// <param name="id">Id of the content item (user) to attach the file to</param> /// <param name="postedFile">A posted image file</param> /// <returns>True or false indicating success or failure</returns> public static bool SaveAvatarFile(this IAvatarsService service, int id, HttpPostedFileBase postedFile) { return(service.SaveAvatarFile(id, postedFile.InputStream, Path.GetExtension(postedFile.FileName))); }
/// <summary> /// Saves an avatar file /// </summary> /// <param name="avatar">The actual AvatarProfilePart attach the file to</param> /// <param name="postedFile">A posted image file</param> /// <returns>True or false indicating success or failure</returns> public static bool SaveAvatarFile(this IAvatarsService service, AvatarProfilePart avatar, HttpPostedFileBase postedFile) { return(service.SaveAvatarFile(avatar.Id, postedFile)); }