Exemplo n.º 1
0
 public static void Filter(IEnumerable list, RetrievingInfo retrievingInfo)
 {
     foreach (var item in list)
     {
         var properties = item.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
         foreach (PropertyInfo propertyInfo in properties)
         {
             var attributes = propertyInfo.GetCustomAttributes(typeof(FilterAttribute), true);
             if (attributes.Length > 0)
             {
                 var filterAttr = (FilterAttribute)attributes[0];
                 if ((filterAttr.FilterType == FilterType.Image && !retrievingInfo.Images) ||
                     (filterAttr.FilterType == FilterType.LongText && !retrievingInfo.LongTexts))
                 {
                     propertyInfo.SetValue(item, null, null);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 public WorkoutPlanDTO GetWorkoutPlan(Token token, Guid planId, RetrievingInfo retrievingInfo)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 3
0
 public IList <MyTrainingDTO> GetStartedTrainings(Token token, Guid?typeId, RetrievingInfo retrievingInfo)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 public TrainingDayDTO GetTrainingDay(Token token, WorkoutDayGetOperation operationParams, RetrievingInfo retrievingInfo)
 {
     throw new NotImplementedException();
 }
 public TrainingDayDTO GetTrainingDay(Token token, WorkoutDayGetOperation operationParams, RetrievingInfo retrievingInfo)
 {
     return(exceptionHandling(token, () => InternalService.GetTrainingDay(token, operationParams, retrievingInfo)));
 }
Exemplo n.º 6
0
        static async public Task <TrainingDayDTO> GetTrainingDayAsync(WorkoutDayGetOperation param, RetrievingInfo retrievingInfo)
        {
            var test = exceptionHandling((client) =>
            {
                return(Task <TrainingDayDTO> .Factory.FromAsync(client.BeginGetTrainingDay, client.EndGetTrainingDay, ApplicationState.Current.SessionData.Token, param, retrievingInfo, null));
            });

            return(await test);
        }
Exemplo n.º 7
0
        public TrainingDayDTO GetTrainingDay(Token token, WorkoutDayGetOperation operationParams, RetrievingInfo retrievingInfo)
        {
            var securityInfo           = SecurityManager.EnsureAuthentication(token);
            TrainingDayService service = new TrainingDayService(Session, securityInfo, Configuration, PushNotificationService, EMailService);

            return(service.GetTrainingDay(operationParams, retrievingInfo));
        }