コード例 #1
0
        protected void RequestAndProcessInputData()
        {
            var args = new InputEventArgs <TData>();

            if (OnInputRequested == null)
            {
                _logger.Error($"No subscribers to {nameof(OnInputRequested)} event. Cannot request for input data.");
                throw new Exception($"No subscribers to {nameof(OnInputRequested)} event. Cannot request for input data.");
            }

            OnInputRequested.Invoke(this, args);

            _logger.Info($"Processing input data of type {typeof(TData).Name} in {GetType().Name}");

            if (args.Data == null)
            {
                _logger.Error($"Input dats is null or not set via {nameof(InputEventArgs<TData>.SetInputData)} method.");
                throw new ArgumentNullException(nameof(InputEventArgs <TData> .Data));
            }

            if (!IsInputDataValid(args.Data))
            {
                _logger.Error("Input data did not pass validation.");
                throw new ArgumentException("Input data did not pass validation.");
            }

            //data should be not null and valid at this time
            InputData = args.Data;

            ProcessInputDataInternal();

            _logger.Info("Input data successfully received and validated.");
        }
コード例 #2
0
ファイル: Input.cs プロジェクト: xpjunior/Ember-MM-Newscraper
 internal void RaiseOnInputRequested(string sender = null, XBMCRPC.Input.OnInputRequested_data data = null)
 {
     if (OnInputRequested != null)
     {
         OnInputRequested.BeginInvoke(sender, data, null, null);
     }
 }
コード例 #3
0
 internal void RaiseOnInputRequested(string sender = null, OnInputRequesteddataType data = null)
 {
     if (OnInputRequested != null)
     {
         OnInputRequested.BeginInvoke(sender, data, null, null);
     }
 }