Exemplo n.º 1
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='eventDeleteCommand'>
 /// </param>
 /// <param name='lang'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <bool?> DeleteEventAsync(this IEventApi operations, LMSApplicationCoreCommandsEventDeleteCommand eventDeleteCommand, string lang, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.DeleteEventWithHttpMessagesAsync(eventDeleteCommand, lang, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
        protected JustGivingClientBase(ClientConfiguration clientConfiguration, 
										IHttpClient httpClient, 
										IAccountApi accountApi, 
										IDonationApi donationApi, 
										IPageApi pageApi, 
										ISearchApi searchApi, 
										ICharityApi charityApi, 
										IEventApi eventApi,
										ITeamApi teamApi)
        {
            if(httpClient == null)
            {
                throw new ArgumentNullException("httpClient", "httpClient must not be null to access the api.");
            }

            HttpClient = httpClient;
            HttpClient.ConnectionTimeOut = TimeSpan.FromMinutes(3);

            Account = accountApi;
            Donation = donationApi;
            Page = pageApi;
            Search = searchApi;
            Charity = charityApi;
            Event = eventApi;
            Team = teamApi;

            Configuration = clientConfiguration;

            InitApis(HttpClient, clientConfiguration);
        }
 public JustGivingClient(ClientConfiguration clientConfiguration, IHttpClient httpClient, IAccountApi accountApi,
                         IDonationApi donationApi, IPageApi pageApi, ISearchApi searchApi, ICharityApi charityApi,
                         IEventApi eventApi, ITeamApi teamApi, IOneSearchApi oneSearch, ICountryApi countryApi,
                         ICurrencyApi currencyApi, IProjectApi projectApi)
     : base(
         clientConfiguration, httpClient, accountApi, donationApi, pageApi, searchApi, charityApi, eventApi,
         teamApi, oneSearch, countryApi, currencyApi, projectApi)
 {
 }
Exemplo n.º 4
0
        /// Remove the current event from the event handler
        public static void Remove <T>(this IEventApi self) where T : class, IEvent
        {
            var handler = self.EventHandler <T>();

            if (handler != null)
            {
                self.EventListener.RemoveEventHandler(self.EventHandler <T>());
            }
        }
Exemplo n.º 5
0
 public NativeOpenClApi()
 {
     PlatformApi     = new NativePlatformApi();
     DeviceApi       = new NativeDeviceApi();
     CommandQueueApi = new NativeCommandQueueApi();
     ContextApi      = new NativeContextApi();
     BufferApi       = new NativeBufferApi();
     ProgramApi      = new NativeProgramApi();
     KernelApi       = new NativeKernelApi();
     EventApi        = new NativeEventApi();
 }
Exemplo n.º 6
0
        /// Push the current event back into the event handler.
        /// Useful for one-shot event handlers that don't want to expired.
        public static void Keep <T>(this IEventApi self) where T : class, IEvent
        {
            var handler = self.EventHandler <T>();

            if (handler != null)
            {
                if (!self.EventListener.ContainsEventHandler(handler))
                {
                    self.EventListener.AddEventHandler(handler);
                }
            }
        }
        protected JustGivingClientBase(ClientConfiguration clientConfiguration,
                                       IHttpClient httpClient,
                                       IAccountApi accountApi,
                                       IDonationApi donationApi,
                                       IPageApi pageApi,
                                       ISearchApi searchApi,
                                       ICharityApi charityApi,
                                       IEventApi eventApi,
                                       ITeamApi teamApi, IOneSearchApi oneSearch,
                                       ICountryApi country, ICurrencyApi currency,
                                       IProjectApi project)
        {
            if (httpClient == null)
            {
                throw new ArgumentNullException("httpClient", "httpClient must not be null to access the api.");
            }

            HttpClient = httpClient;
            HttpClient.ConnectionTimeOut = TimeSpan.FromMinutes(3);

            Account   = accountApi;
            Donation  = donationApi;
            Page      = pageApi;
            Search    = searchApi;
            Charity   = charityApi;
            Event     = eventApi;
            Team      = teamApi;
            OneSearch = oneSearch;
            Country   = country;
            Currency  = currency;
            Project   = project;

            Configuration = clientConfiguration;

            InitApis(HttpClient, clientConfiguration);
        }
 public JustGivingClient(ClientConfiguration clientConfiguration, IHttpClient httpClient, IAccountApi accountApi,
                         IDonationApi donationApi, IPageApi pageApi, ISearchApi searchApi, ICharityApi charityApi,
                         IEventApi eventApi, ITeamApi teamApi): base(clientConfiguration, httpClient, accountApi, donationApi, pageApi, searchApi, charityApi, eventApi, teamApi)
 {
 }
Exemplo n.º 9
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='eventListCommand'>
 /// </param>
 /// <param name='lang'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <LMSApplicationCoreViewModelEventEventsListViewModel> GetEventsAsync(this IEventApi operations, LMSApplicationCoreCommandsEventsListCommand eventListCommand, string lang, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetEventsWithHttpMessagesAsync(eventListCommand, lang, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 10
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='eventListCommand'>
 /// </param>
 /// <param name='lang'>
 /// </param>
 public static LMSApplicationCoreViewModelEventEventsListViewModel GetEvents(this IEventApi operations, LMSApplicationCoreCommandsEventsListCommand eventListCommand, string lang)
 {
     return(operations.GetEventsAsync(eventListCommand, lang).GetAwaiter().GetResult());
 }
Exemplo n.º 11
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='updateEventCommand'>
 /// </param>
 /// <param name='lang'>
 /// </param>
 public static LMSApplicationCoreViewModelEventEventViewModel UpdateEvent(this IEventApi operations, LMSApplicationCoreCommandsEventAddEditCommand updateEventCommand, string lang)
 {
     return(operations.UpdateEventAsync(updateEventCommand, lang).GetAwaiter().GetResult());
 }
Exemplo n.º 12
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='eventId'>
 /// </param>
 /// <param name='lang'>
 /// </param>
 public static LMSApplicationCoreViewModelEventEventViewModel GetEventDetails(this IEventApi operations, string eventId, string lang)
 {
     return(operations.GetEventDetailsAsync(eventId, lang).GetAwaiter().GetResult());
 }
Exemplo n.º 13
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='eventDeleteCommand'>
 /// </param>
 /// <param name='lang'>
 /// </param>
 public static bool?DeleteEvent(this IEventApi operations, LMSApplicationCoreCommandsEventDeleteCommand eventDeleteCommand, string lang)
 {
     return(operations.DeleteEventAsync(eventDeleteCommand, lang).GetAwaiter().GetResult());
 }
Exemplo n.º 14
0
 /// Defer a trigger action to run at the end of an event
 public static void Trigger(this IEventApi self, IEvent data)
 {
     self.EventTrigger.Trigger(data);
 }