Example #1
0
        //////////////////////////////////////////////////////////////////////
        /// <summary>eventchaining. We catch this by from the base service, which
        /// would not by default create an atomFeed</summary>
        /// <param name="sender"> the object which send the event</param>
        /// <param name="e">FeedParserEventArguments, holds the feedentry</param>
        /// <returns> </returns>
        //////////////////////////////////////////////////////////////////////
        protected void OnNewFeed(object sender, ServiceEventArgs e)
        {
            Tracing.TraceMsg("Created new Webmaster Tools Feed");
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            if (e.Uri.AbsolutePath.IndexOf("feeds") != -1 && e.Uri.AbsolutePath.IndexOf("keywords") != -1)
            {
                // keywords base url: https://www.google.com/webmasters/tools/feeds/siteID/keywords/
                e.Feed = new KeywordsFeed(e.Uri, e.Service);
            }
            else if (e.Uri.AbsolutePath.IndexOf("feeds/messages/") != -1)
            {
                // messages feeds are https://www.google.com/webmasters/tools/feeds/messages/
                e.Feed = new MessagesFeed(e.Uri, e.Service);
            }
            else if (e.Uri.AbsolutePath.IndexOf("feeds/sites/") != -1)
            {
                // messages feeds are https://www.google.com/webmasters/tools/feeds/sites/
                e.Feed = new SitesFeed(e.Uri, e.Service);
            }
            else if (e.Uri.AbsolutePath.IndexOf("feeds") != -1 && e.Uri.AbsolutePath.IndexOf("crawlissues") != -1)
            {
                // crawl issues are https://www.google.com/webmasters/tools/feeds/siteID/crawlissues/
                e.Feed = new CrawlIssuesFeed(e.Uri, e.Service);
            }
            else if (e.Uri.AbsolutePath.IndexOf("feeds") != -1 &&
                     e.Uri.AbsolutePath.IndexOf("sitemaps") != -1)
            {
                // crawl issues are https://www.google.com/webmasters/tools/feeds/siteID/sitemaps/
                e.Feed = new SitemapsFeed(e.Uri, e.Service);
            }
        }
Example #2
0
 protected virtual void OnServerError(ServiceEventArgs e)
 {
     if (ServerErrorReturned != null)
     {
         ServerErrorReturned(this, e);
     }
 }
Example #3
0
 protected void OnNewFeed(object sender, ServiceEventArgs e)
 {
     //Tracing.TraceMsg("Created new Webmaster Tools Feed");
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     if ((e.Uri.AbsolutePath.IndexOf("feeds") != -1) && (e.Uri.AbsolutePath.IndexOf("keywords") != -1))
     {
         e.Feed = new KeywordsFeed(e.Uri, e.Service);
     }
     else if (e.Uri.AbsolutePath.IndexOf("feeds/messages/") != -1)
     {
         e.Feed = new MessagesFeed(e.Uri, e.Service);
     }
     else if (e.Uri.AbsolutePath.IndexOf("feeds/sites/") != -1)
     {
         e.Feed = new SitesFeed(e.Uri, e.Service);
     }
     else if ((e.Uri.AbsolutePath.IndexOf("feeds") != -1) && (e.Uri.AbsolutePath.IndexOf("crawlissues") != -1))
     {
         e.Feed = new CrawlIssuesFeed(e.Uri, e.Service);
     }
     else if ((e.Uri.AbsolutePath.IndexOf("feeds") != -1) && (e.Uri.AbsolutePath.IndexOf("sitemaps") != -1))
     {
         e.Feed = new SitemapsFeed(e.Uri, e.Service);
     }
 }
Example #4
0
        void FinanceService_NewFeed(object sender, ServiceEventArgs e)
        {
            Tracing.TraceMsg("Created new Portfolio Feed");

            int i = e.Uri.AbsoluteUri.IndexOf("/" + "portfolios");
            int p = e.Uri.AbsoluteUri.IndexOf("/" + "positions");
            int t = e.Uri.AbsoluteUri.IndexOf("/" + "transactions");

            // TODO: This sucks, it needs to be changed to parse out the Feeds correcly.
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }
            else if (e.Uri.AbsoluteUri.IndexOf("/" + "transactions") != -1)
            {
                e.Feed = new TransactionFeed(e.Uri, e.Service);
            }
            else if (e.Uri.AbsoluteUri.IndexOf("/" + "positions") != -1)
            {
                e.Feed = new PositionFeed(e.Uri, e.Service);
            }
            else if (e.Uri.AbsoluteUri.IndexOf("/" + "portfolios") != -1)
            {
                e.Feed = new PortfolioFeed(e.Uri, e.Service);
            }
        }
Example #5
0
 private void ServiceManager_ServiceStatusChanged(object sender, ServiceEventArgs args)
 {
     if (this.services.Contains(args.Service))
     {
         this.metaStrategyBase.SetServiceStatusChanged(args);
     }
 }
Example #6
0
        private void OnLocationsRetrieved(object sender, ServiceEventArgs e)
        {
            List <RhitLocation> locations = DataCollector.Instance.GetAllLocations(null);

            foreach (RhitLocation location in locations)
            {
                if (location.Id < 0)
                {
                    continue;
                }
                if (Locations.ContainsKey(location.Id))
                {
                    continue;
                }
                Locations[location.Id] = location;
            }

            TempDict = new Dictionary <int, LocationNode>();

            foreach (RhitLocation location in locations)
            {
                AddNode(location);
            }

            ChangeLocation(LocationTree[0] as object);
        }
Example #7
0
            private void ResponseBuscar(ServiceEventArgs<List<BingResource>> e)
            {
                  bool error = true;
                  if (!e.ErrorInMakingRequest) {
                        error = false;
                        e.Dto[0].resources.ForEach((_) => {
                              this._resultadosBing.Add(new BingLocationItemViewModel(_));
                        });

                        NotifyPropertyChanged("ResultadosBing");

                        if (BuscarComplete != null) {
                              this._dispatcher.BeginInvoke(() => { BuscarComplete(); });
                        }
                  }

                  if (error) {
                        if (ProcesoError != null) {
                              this._dispatcher.BeginInvoke(() => {
                                    ProcesoError(new Global.ViewModelEventArgs() {
                                          ErrorInMakingRequest = e.ErrorInMakingRequest,
                                          Error = e.Error
                                    });
                              });
                        }
                  }
            }
            private void responseSincronizacionSoftToken(ServiceEventArgs<DtoSincronizacionST> e)
            {
                  bool resultado = false;
                  string fecha = string.Empty;
                  string hora = string.Empty;
                  string referencia = string.Empty;
                  if (!e.ErrorInMakingRequest) 
                  {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              resultado = true;
                              fecha = e.Dto.fecha;
                              hora = e.Dto.hora;
                              referencia = e.Dto.referencia;
                        }                                    
                        else
                        {
                            _dispatcher.BeginInvoke(() => { MessageBox.Show(e.Error.message); });
                        }
                  }
                  else 
                  {
                        _dispatcher.BeginInvoke(() => { MessageBox.Show(TextosFront.frontMensajeErrorConexion); });
                        e.Error = new Model.Base.Error();
                        e.Error.clave = string.Empty;
                  }

                  if (sincronizarSoftTokenCompleted != null) 
                  {
                        sincronizarSoftTokenCompleted(resultado,e.Error.clave,fecha,hora, referencia);
                  }
            }
        private void ResponseDesbloqueoToken(ServiceEventArgs<DtoDesbloqueoToken> e)
        {

            if (!e.ErrorInMakingRequest)
            {
                args.error = e.ErrorInMakingRequest;
                args.clave = e.Error.clave;
                if (!e.Error.clave.Is(Errors.Generic.OK))
                {
                    _dispatcher.BeginInvoke(() => { MessageBox.Show(e.Error.message); });                  
                }else if(e.Error.clave.Is(Errors.Generic.OK)){
                    if (null != e.Dto)
                    {
                        args.fecha = e.Dto.fecha;
                        args.hora = e.Dto.hora;
                        args.referencia = e.Dto.referencia;
                    }
                }
            }
            else
            {
                _dispatcher.BeginInvoke(() => { MessageBox.Show(TextosFront.frontMensajeErrorConexion); });
            }


            if (null != desbloqueoTokenCompleted)
            {
                _dispatcher.BeginInvoke(() =>
                {
                    desbloqueoTokenCompleted(args);
                });
            }
        }
Example #10
0
        private void responseBloquearToken(ServiceEventArgs<DtoBloquearToken> e)
        {
            bool resultado = false;
            if (!e.ErrorInMakingRequest)
            {
                if (e.Error.clave.Is(Errors.Generic.OK))
                {
                    resultado = true;
                   

                    this.Fecha = e.Dto.fecha;
                    this.Hora = e.Dto.hora;
                    this.Referencia = e.Dto.referencia;
                }
                else
                {
                    _dispatcher.BeginInvoke(() => { MessageBox.Show(e.Error.message); });
                }
            }
            else
            {
                _dispatcher.BeginInvoke(() => { MessageBox.Show(TextosFront.frontMensajeErrorConexion); });
            }
            if (bloqueoTokenCompleted != null)
            {
                bloqueoTokenCompleted(resultado, e.Error.clave);
            }
        }
 protected void responseGetDatosUsuario(ServiceEventArgs<DtoGetDatosUsuario> e)
 {
     if (!e.ErrorInMakingRequest)
     {
         switch (e.Error.clave)
         {
             case Errors.Generic.OK:
                 this._companiasCelulares.Clear();
                 e.Dto.catalogoCompanias.ForEach((__) => { this._companiasCelulares.Add(new CompaniaCelularItemViewModel(__)); });
                 this.companiaCelular = this._companiasCelulares.Where(__ => __.Id.ToUpper().Equals(e.Dto.companiaTelefonoCelular)).FirstOrDefault();
                 this.correoElectronico = e.Dto.correoElectronico;
                 this.telefonoCelular = e.Dto.telefonoCelular;
                 if (null != responseCompleted)
                 {
                     responseCompleted();
                 }
                 break;
             default:
                 MessageBox.Show(e.Error.message);
                 this._isMessage = true;
                 responseCompleted();
                 break;
         }
     }
     else
     {
         if (null != ProcesoError)
         {
             base._dispatcher.BeginInvoke(() =>
             {
                 ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = e.ErrorInMakingRequest });
             });
         }
     }
 }
Example #12
0
        private void m_ArtificiallakeController_QueryEvent(object sender, ServiceEventArgs e)
        {
            this.Invoke(new MethodInvoker(delegate()
            {
                if (e != null)
                {
                    string content = e.Content;
                    try
                    {
                        GetListResultInfo <Fire_Artificiallake> result = JsonHelper.JSONToObject <GetListResultInfo <Fire_Artificiallake> >(content);

                        if (result.rows != null && result.rows.Count > 0)
                        {
                            this.m_ArtificiallakeList = result.rows;

                            this.pagerControl1.NMax = result.total;
                            this.FillData(m_ArtificiallakeList);
                        }
                        else
                        {
                            this.pagerControl1.NMax = 0;
                            this.FillData(null);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(this, ex.Message, "提示");
                    }
                }
                else
                {
                    MessageBox.Show(this, sender.ToString(), "提示");
                }
            }));
        }
Example #13
0
        private void m_HotController_AddEvent(object sender, ServiceEventArgs e)
        {
            this.Invoke(new MethodInvoker(delegate()
            {
                if (e != null)
                {
                    string content = e.Content;

                    try
                    {
                        BaseResultInfo <string> result = JsonHelper.JSONToObject <BaseResultInfo <string> >(content);

                        if (result.status == 10000)
                        {
                            this.DialogResult = DialogResult.OK;
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show(this, result.msg, "提示");
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(this, ex.Message, "提示");
                    }
                }
                else
                {
                    MessageBox.Show(this, sender.ToString(), "提示");
                }
            }));
        }
Example #14
0
        private void TotalNetAmountHandler(object sender, ServiceEventArgs se)
        {
            ServiceResponse result = se.Result;

            if (result.Status)
            {
                string netTotal = (string)result.Output;
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    ApproveConfirmation                  = new InvoiceConfirmationDetails();
                    ApproveConfirmation.NetTotal         = netTotal;
                    ApproveConfirmation.SelectedInvoices = InvoiceListModel.InvoiceList.Where(x => x.IsCheckboxChecked).ToList();

                    Uri uri = new Uri("/Tymetrix.T360.Mobile.Client.AppWP7;component/Invoice/ConfirmationPage.xaml", UriKind.Relative);
                    this.NavigationService.Navigate(uri);
                });
            }
            else
            {
                List <Error> resultError = result.ErrorDetails;
                ShowError(new AppException(resultError));
                if (resultError[0] != null && T360ErrorCodes.NotInReviewerQueue == resultError[0].Code)
                {
                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                    {
                        RedirectToInvoiceList();
                    });
                }
                else
                {
                    ManageAppBarVisible(true);
                }
            }
        }
Example #15
0
        private void m_AreaCodeController_QueryEvent(object sender, ServiceEventArgs e)
        {
            if (IsDisposed || !this.IsHandleCreated)
            {
                return;
            }

            this.Invoke(new MethodInvoker(delegate()
            {
                if (e != null)
                {
                    string content = e.Content;

                    try
                    {
                        GetListResultInfo <AreaCodeInfo> result = JsonHelper.JSONToObject <GetListResultInfo <AreaCodeInfo> >(content);

                        if (result.rows != null && result.rows.Count > 0)
                        {
                            m_AreaList = result.rows;

                            this.LoadProvince(m_AreaList);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(this, ex.Message, "信息提示");
                    }
                }
                else
                {
                    MessageBox.Show(sender.ToString(), "获取行政区出错", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }));
        }
Example #16
0
 /// <summary>
 /// 触发服务变更事件
 /// </summary>
 /// <param name="bundle">引发的模块</param>
 /// <param name="serviceEventArgs">服务事件参数</param>
 public void FireServiceChanged(IBundle bundle, ServiceEventArgs serviceEventArgs)
 {
     if (this.ServiceChanged != null)
     {
         this.ServiceChanged(bundle, serviceEventArgs);
     }
 }
Example #17
0
        private void AdjustLineItem(object sender, ServiceEventArgs args)
        {
            ServiceResponse result = args.Result;

            if (result.Status)
            {
                AdjustInput = JsonConvert.DeserializeObject <List <ReasonCode> >(result.Output);

                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    this.ProgressBar.Show();
                    PageInProgress = true;
                    Uri uri        = new Uri("/Tymetrix.T360.Mobile.Client.AppWP8;component/Invoice/AdjustPage.xaml", UriKind.Relative);
                    this.NavigationService.Navigate(uri);
                    this.ProgressBar.Hide();
                });
            }
            else
            {
                List <Error> resultError = result.ErrorDetails;
                ShowError(new AppException(resultError), Constants.InvoiceReasonsError);
                if (resultError[0] != null && T360ErrorCodes.NotInReviewerQueue == resultError[0].Code)
                {
                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                    {
                        this.ProgressBar.Hide();
                        PageInProgress = false;
                        RedirectToInvoiceList();
                    });
                }
            }
        }
            private void ResponseBuscarSucursales(ServiceEventArgs<List<Geolocalizacion>> e)
            {
                  bool error = true;
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              error = false;
                              var sucursales = (from sc in e.Dto select new PushpinItemViewModel(sc) { Index = this._countIndex++ }).ToList();

                              if (sucursales != null && sucursales.Count > 0) {
                                    sucursales.ForEach((_) => { this._sucursales.Add(_); });
                              }

                              if (BuscarSucursalesComplete != null) {
                                    this._dispatcher.BeginInvoke(() => { BuscarSucursalesComplete(); });
                              }
                        }
                  }

                  if (error) {
                        if (ProcesoError != null) {
                              this._dispatcher.BeginInvoke(() => {
                                    ProcesoError(new Global.ViewModelEventArgs() {
                                          ErrorInMakingRequest = e.ErrorInMakingRequest,
                                          Error = e.Error
                                    });
                              });
                        }
                  }
            }
Example #19
0
        private void m_ArtificiallakeController_DeleteEvent(object sender, ServiceEventArgs e)
        {
            this.Invoke(new MethodInvoker(delegate()
            {
                if (e != null)
                {
                    string content = e.Content;

                    try
                    {
                        BaseResultInfo <string> result = JsonHelper.JSONToObject <BaseResultInfo <string> >(content);

                        if (result.status == 10000)
                        {
                            this.GetArtificiallakeList(this.navigationControl1.Pac);
                        }
                        else
                        {
                            MessageBox.Show(this, result.msg, "信息提示");
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(this, ex.Message, "信息提示");
                    }
                }
                else
                {
                    MessageBox.Show(this, sender.ToString(), "提示");
                }
            }));
        }
Example #20
0
 protected virtual void OnUpdated(ServiceEventArgs e)
 {
     if (UpdateAvailable != null)
     {
         UpdateAvailable(this, e);
     }
 }
            private void ResponseMovimientosInterbancarios(ServiceEventArgs<List<EstatusTransferencia>> e)
            {
                  bool error = true;
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              error = false;
                        }
                  }

                  if (error) {
                        if (ProcesoError != null) {
                              this._dispatcher.BeginInvoke(() => {
                                    ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = e.ErrorInMakingRequest, Error = e.Error });
                              });
                        }
                  }
                  else {
                        var estatus = (from sc in e.Dto
                                       select new EstatusTransferenciaItemViewModel(sc)).ToList();
                        estatus.ForEach((_) => { this._estatusTransferias.Add(_); });

                        if (MovimientosInterbancarioComplete != null) {
                              this._dispatcher.BeginInvoke(() => {
                                    MovimientosInterbancarioComplete();
                              });
                        }
                  }
            }
        /// <summary>eventchaining. We catch this by from the base service, which
        /// would not by default create an atomFeed</summary>
        /// <param name="sender"> the object which send the event</param>
        /// <param name="e">FeedParserEventArguments, holds the feedentry</param>
        /// <returns> </returns>
        protected void OnNewFeed(object sender, ServiceEventArgs e)
        {
            Tracing.TraceMsg("Created new Content for Shopping Feed");
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            string service = ParseService(e.Uri.AbsoluteUri);

            if (service == "items")
            {
                e.Feed = new ProductFeed(e.Uri, e.Service);
            }
            else if (service == "managedaccounts")
            {
                e.Feed = new ManagedAccountsFeed(e.Uri, e.Service);
            }
            else if (service == "datafeeds")
            {
                e.Feed = new DatafeedFeed(e.Uri, e.Service);
            }
            else if (service == "dataquality")
            {
                e.Feed = new DataQualityFeed(e.Uri, e.Service);
            }
            else if (service == "users")
            {
                e.Feed = new UsersFeed(e.Uri, e.Service);
            }
            else if (service == "inventory")
            {
                e.Feed = new InventoryFeed(e.Uri, e.Service);
            }
        }
Example #23
0
 public void OnUpdateInstallationSchedule(object sender, ServiceEventArgs e)
 {
     if (UpdateInstallationScheduleEvent != null && e != null)
     {
         e.EventType = EventType.UpdateInstallationSchedule;
         this.UpdateInstallationScheduleEvent.Invoke(sender, e);
     }
 }
 internal static void OnServiceChanged(ServiceEventArgs e)
 {
     if(events[servicekey] != null)
     {
         ServiceEventHandler handler = events[servicekey] as ServiceEventHandler;
         handler(null, e);
     }
 }
        public void ServiceEventArgsConstructorTest()
        {
            Uri              uri     = new Uri("http://www.test.com/");
            IService         service = new Service();
            ServiceEventArgs target  = new ServiceEventArgs(uri, service); // TODO: Initialize to an appropriate value

            Assert.IsNotNull(target);
        }
Example #26
0
 public void OnWriteFileLog(object sender, ServiceEventArgs e)
 {
     if (WriteFileLogEvent != null && e != null)
     {
         e.EventType = EventType.WriteFileLog;
         this.WriteFileLogEvent.Invoke(sender, e);
     }
 }
Example #27
0
 public void DispatchServiceEvent(object sender, ServiceEventArgs e)
 {
     if (_serviceDispatcher != null)
     {
         List <EventHandler <ServiceEventArgs> > listeners = new List <EventHandler <ServiceEventArgs> >(_serviceListeners);
         _serviceDispatcher.DispatchToAsyncListeners(sender, e, listeners);
     }
 }
 internal static void OnServiceChanged(ServiceEventArgs e)
 {
     if (events[servicekey] != null)
     {
         ServiceEventHandler handler = events[servicekey] as ServiceEventHandler;
         handler(null, e);
     }
 }
Example #29
0
 /// <summary>
 /// Feed handler.  Instantiates a new <code>EmailListRecipientFeed</code>.
 /// </summary>
 /// <param name="sender">the object that's sending the evet</param>
 /// <param name="e"><code>ServiceEventArgs</code>, holds the feed</param>
 protected void OnParsedNewFeed(object sender, ServiceEventArgs e)
 {
     Tracing.TraceMsg("Created new email list recipient feed");
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     e.Feed = new EmailListRecipientFeed(e.Uri, e.Service);
 }
        private void UpdatedRateHandler(object sender, ServiceEventArgs <CurrencyExchange> e)
        {
            var Result = new StringBuilder();

            Result.Append($"{e.Result[0]?.ContributedCurrency} - {e.Result[0]?.TargetCurrency} : {e.Result[0]?.Rate}\n");
            Result.Append($"{e.Result[1]?.ContributedCurrency} - {e.Result[1]?.TargetCurrency} : {e.Result[1]?.Rate}\n");
            Result.Append(e.Message);
            _kernel.Get <DialogWindowPresenter>().SendMessage(Result.ToString());
        }
Example #31
0
        /// <summary>
        /// Feed handler. Instantiates a new <code>GenericFeed</code>.
        /// </summary>
        /// <param name="sender">the object that's sending the event</param>
        /// <param name="e"><code>ServiceEventArgs</code>, holds the feed</param>
        protected void OnParsedNewFeed(object sender, ServiceEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            e.Feed = getFeed(e.Uri, e.Service);
        }
Example #32
0
 //////////////////////////////////////////////////////////////////////
 /// <summary>eventchaining. We catch this by from the base service, which
 /// would not by default create an atomFeed</summary>
 /// <param name="sender"> the object which send the event</param>
 /// <param name="e">FeedParserEventArguments, holds the feedentry</param>
 /// <returns> </returns>
 //////////////////////////////////////////////////////////////////////
 protected void OnNewFeed(object sender, ServiceEventArgs e)
 {
     Tracing.TraceMsg("Created new Calendar Feed");
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     e.Feed = new BloggerFeed(e.Uri, e.Service);
 }
Example #33
0
        private void OnServiceRemoved(ServiceEventArgs e)
        {
            EventHandler <ServiceEventArgs> handler = ServiceRemoved;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Example #34
0
        private void device_ServiceAdded(object sender, ServiceEventArgs e)
        {
            //Technically we should only do this once per service type,
            //but if we add services during runtime there is no way to
            //notify anyone except by resending this notification.
            _Log.LogInfo(String.Format("Service added: {0} ({1})", e.Service.ServiceId, e.Service.FullServiceType));

            SendAliveNotification((SsdpDevice)sender, e.Service);
        }
 /// <summary>
 /// Overridden so that new feeds are returned as <code>GoogleMailSettingsFeed</code>s
 /// instead of base <code>AtomFeed</code>s.
 /// </summary>
 /// <param name="sender"> the object which sent the event</param>
 /// <param name="e">FeedParserEventArguments, holds the FeedEntry</param>
 protected void OnNewFeed(object sender, ServiceEventArgs e)
 {
     Tracing.TraceMsg("Created new Google Groups Item Feed");
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     e.Feed = new AppsExtendedFeed(e.Uri, e.Service);
 }
Example #36
0
        private void OnLocationsRetrieved(object sender, ServiceEventArgs e)
        {
            List <RhitLocation> locations = DataCollector.Instance.GetAllLocations(null);

            if (locations == null || locations.Count <= 0)
            {
                return;
            }
            Locations.SetLocations(locations);
        }
        public void ServiceTest()
        {
            Uri              uri     = new Uri("http://www.test.com/");
            Service          service = new Service();
            ServiceEventArgs target  = new ServiceEventArgs(uri, service); // TODO: Initialize to an appropriate value
            Service          actual;

            actual = target.Service as Service;
            Assert.AreEqual(actual, service);
        }
 private void ViewingTodayExchangeRateHandler(object sender, ServiceEventArgs <CurrencyExchange> e)
 {
     if (e.Status)
     {
         _window.TodayCourse = e.Result.GetTodayRate();
     }
     else
     {
         _kernel.Get <DialogWindowPresenter>().SendMessage(e.Message);
     }
 }
        void ClientServiceAdded(object sender, ServiceEventArgs args)
        {
            if (args.Service.Type != ConnectionManager1.ServiceType) return;

            try {
                ConnectionManager1 service = new ConnectionManager1 (args.Service);
                OnConnectionManager1Added (service);
            }
            catch
            {
            }
        }
        void ClientServiceAdded (object sender, ServiceEventArgs args)
        {
            if (args.Service.Type != ContentDirectory.ServiceType) return;

            try {
                var description = args.Service.GetService ();
                if (description != null) {
                    var controller = description.GetController ();
                    if (controller != null) {
                        //var service = new Deserializer (new ContentDirectoryController (controller));
                        //OnContentDirectoryAdded (new DiscoveryEventArgs<Deserializer> (service));
                    }
                }
            } catch {
            }
        }
 private void ResponseActivarToken(ServiceEventArgs<string> e) {
       bool activacion = false;
       if (!e.ErrorInMakingRequest) {
             if (e.Error.clave.Is(Errors.Generic.OK)) {
                   activacion = true;
                   (Application.Current as App).EstatusToken = EstatusToken.A;
             } else {
                   _dispatcher.BeginInvoke(() => { MessageBox.Show(e.Error.message); });
             }
       } else {
             _dispatcher.BeginInvoke(() => { MessageBox.Show(TextosFront.frontMensajeErrorConexion); });
       }
       if (ActivarTokenCompleted != null) {
             ActivarTokenCompleted(activacion, e.Error.clave);
       }
 }
            private void responseBloqueoTemporalSM(ServiceEventArgs<DtoBloquearNip> e)
            {
                  bool resultado = false;
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              ReferenciaSM = e.Dto.numRef;
                              resultado = true;
                        }
                        else {
                              _dispatcher.BeginInvoke(() => { MessageBox.Show(e.Error.message); });
                        }
                  }
                  else {
                        _dispatcher.BeginInvoke(() => { MessageBox.Show(TextosFront.frontMensajeErrorConexion); });
                  }

                  if (bloqueoTemporalSMCompleted != null) {
                        bloqueoTemporalSMCompleted(resultado,e.Error.clave);
                  }
            }
            private void ResponseCambiarNip(ServiceEventArgs<DtoCambiarNipAcceso> e)
            {
                  bool error = true;
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              error = false;
                              if (CambiarNipComplete != null) {
                                    this._dispatcher.BeginInvoke(() => {
                                          CambiarNipComplete(e.Dto.mensaje);
                                    });
                              }
                        }
                  }

                  if (error) {
                        if (ProcesoError != null) {
                              this._dispatcher.BeginInvoke(() => {
                                    ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = e.ErrorInMakingRequest, Error = e.Error });
                              });
                        }
                  }
            }
            private void ResponseGetFechaActual(ServiceEventArgs<DtoGetFechaActual> e)
            {
                  bool resultado = false;
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              FechaActual = e.Dto;
                              resultado = true;
                        }
                        else {
                              _dispatcher.BeginInvoke(() => { MessageBox.Show(e.Error.message); });
                        }
                  }
                  else {
                        _dispatcher.BeginInvoke(() => {
                              MessageBox.Show(TextosFront.frontMensajeErrorConexion);
                        });
                  }

                  if (getFechaActualCompleted != null) {
                        getFechaActualCompleted(resultado,e.Error.clave);
                  }
                  
            }
            private void responseSincronizarToken(ServiceEventArgs<DtoValidaToken> e)
            {
                  bool resultado = false;
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              resultado = true;
                        }
                        else if (e.Error.clave.Is(Errors.Token.BLOQUEO_TEMPORAL_TOKEN))
                        {
                            (Application.Current as App).EstatusToken = EstatusToken.T;
                            MessageBox.Show(TextosFront.frontMensajeTokenBloqueadoTemporal2, string.Empty, MessageBoxButton.OK);
                        }
                        else if (e.Error.clave.Is(Errors.Generic.GBL_04))
                        {
                            resultado = true;
                            if (null != e.Dto && !string.IsNullOrEmpty(e.Dto.estatusToken))
                            {
                                
                                e.Error.clave = Errors.Token.BLOQUEO_TEMPORAL_TOKEN;
                            }
                            _dispatcher.BeginInvoke(() => { MessageBox.Show(e.Error.message); });
                        }
                        else
                        {
                            _dispatcher.BeginInvoke(() => { MessageBox.Show(e.Error.message); });
                        }
                  }
                  else {
                        _dispatcher.BeginInvoke(() => { MessageBox.Show(TextosFront.frontMensajeErrorConexion); });
                        e.Error = new Model.Base.Error();
                        e.Error.clave = string.Empty;
                  }

                  if (sincronizarTokenCompleted != null) {
                        sincronizarTokenCompleted(resultado,e.Error.clave);
                  }
            }
            private void responseConsultaBitacoraOperaciones(ServiceEventArgs<List<DtoConsultaBitacoraOperaciones>> e)
            {
                  ClienteEventArgs clienteEA = new ClienteEventArgs() { datosBase = e.Error, ErrorCliente = e.ErrorInMakingRequest };
                  bool error = false;
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              this._operacionesBitacoraList = new List<DtoConsultaBitacoraOperaciones>(e.Dto);
                              error = false;
                        }
                        else {
                              error = true;
                        }
                  }
                  else {
                        error = true;
                  }

                  if (error)
                        this._operacionesBitacoraList = new List<DtoConsultaBitacoraOperaciones>();

                  if (consultaBitacoraOperacionesCompleted != null) {
                        consultaBitacoraOperacionesCompleted(clienteEA);
                  }
            }
Example #47
0
            private void ResponseGetCuentasRegistradas(ServiceEventArgs<DtoGetCuentasRegistradas> e)
            {
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              var cuentas = (from sc in e.Dto.cuentas
                                             group sc.numeroCuenta by new { sc.numeroCuenta } into r
                                             select r).ToList();

                              cuentas.ForEach((_) => {
                                    CuentasRegistradas.Add(e.Dto.cuentas.Where(x => x.numeroCuenta.Equals(_.Key.numeroCuenta)).Select(y => new CuentaItemViewModel(y)).FirstOrDefault());
                              });
                              CuentasRegistradas.OrderBy(_ => _.Titular);
                        }
                  }

                  if (ViewModelLoaded != null) {
                        this._dispatcher.BeginInvoke(() => {
                              ViewModelLoaded(new Global.ViewModelEventArgs() {
                                    ErrorInMakingRequest = e.ErrorInMakingRequest,
                                    Error = e.Error
                              });
                        });
                  }
            }
            private void responseGetCuentasPropiasC(ServiceEventArgs<List<Cuenta>> e)
            {
                  ClienteEventArgs clienteEA = new ClienteEventArgs() { datosBase = e.Error, ErrorCliente = e.ErrorInMakingRequest };
                  bool error = false;
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              this._cuentasPropiasList = new List<Cuenta>(e.Dto);
                              string divisa = String.Empty;
                              this._cuentasList = new ObservableCollection<CuentasConsultaBitacoraItemsViewModel>();
                              this._cuentasList.Add(new CuentasConsultaBitacoraItemsViewModel() { NoCuenta = TextosPantallas.tItemTodas, Divisa = "", TipoProducto = "" });
                              foreach (var item in this._cuentasPropiasList) {

                                    if (Convert.ToBoolean(item.dolares))
                                          divisa = FormatoDivisa.usd;
                                    else
                                          divisa = FormatoDivisa.mxp;

                                    this._cuentasList.Add(new CuentasConsultaBitacoraItemsViewModel() {
                                          // Ya no se modifico el nombre del campo TipoProducto a TipoCuenta
                                          NoCuenta = item.numeroCuenta,
                                          Divisa = divisa,
                                          TipoProducto = item.tipoCuenta
                                    });
                              }
                              error = false;
                        }
                        else {
                              error = true;
                        }
                  }
                  else {
                        error = true;
                  }

                  if (error)
                        this._cuentasPropiasList = new List<Cuenta>();

                  if (getCuentasPropiasCompleted != null) {
                        getCuentasPropiasCompleted(clienteEA);
                  }
            }
 private void responseSetNuevoNip(ServiceEventArgs<string> e)
 {
     if (nuevoNipCompleted != null)
     {
         nuevoNipCompleted(e.ErrorInMakingRequest, e.Error);
     }
 }
Example #50
0
        private void ResponseRegistrarDatosContactoCliente(ServiceEventArgs<string> e)
        {
            bool error = true;
            if (!e.ErrorInMakingRequest)
            {
                switch (e.Error.clave)
                {
                    case Errors.Generic.OK:
                        error = false;
                        if (
                              this._estatusRSA == ClavesOtros.RSA_NOTENROLLED ||
                              this._estatusRSA == ClavesOtros.RSA_UNVERIFIED)
                        {
                            GetCatalogoImagenesPreguntas();
                        }
                        else
                        {
                            AfiliarSupermovil(
                                  string.Empty,
                                  string.Empty,
                                  string.Empty,
                                  string.Empty
                            );
                        }
                        break;
                    default:
                        error = false;
                        if (null != ProcesoError)
                        {
                            this._dispatcher.BeginInvoke(() =>
                            {
                                ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = error, Error = e.Error });
                            });
                        }
                        break;
                }
            }

            if (error)
            {
                if (ProcesoError != null)
                {
                    this._dispatcher.BeginInvoke(() =>
                    {
                        ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = e.ErrorInMakingRequest, Error = e.Error });
                    });
                }
            }
        }
        private void responseValidaNipAsyncComplete(ServiceEventArgs<DtoValidarNip> e)
        {
            bool error = false;
            if (!e.ErrorInMakingRequest)
            {
                if (e.Error.clave.Is(Errors.Generic.OK))
                {
                    ReqValidarNip req = new ReqValidarNip()
                    {
                        claveCliente = e.Dto.codCliente,
                        nip = this._nip,
                        tipoOperacion = ClavesOperacion.CodigoCliente
                    };

                    Services.ValidaNip(base.ServiceRequest, responseValidaNipAsyncComplete2, req, this._tipoNip);
                }
                else
                {
                    error = true;
                }
            }
            else
            {
                error = true;
            }

            if (error)
            {
                if (validaAccesoBancaSuperTError != null)
                    validaAccesoBancaSuperTError(e.ErrorInMakingRequest, e.Error);
            }
        }
 private void ResponseLogin(ServiceEventArgs<DtoLogin> e)
 {
     if (!e.ErrorInMakingRequest)
     {
         switch (e.Error.clave)
         {
             case Errors.Login.CLIENTE_BLOQUEADO_POR_INACTIVIDAD:
             case Errors.Login.CLIENTE_BLOQUEADO_POR_REINTENTOS:
             case Errors.Login.BLOQUEADO_POR_NO_REALIZAR_CAMBIO_NIP:
             case Errors.Login.BLOQUEADO_USUARIO_SUPERNET:
             case Errors.Login.BW01_68:
                 ReqValidarNip req = new ReqValidarNip()
                 {
                     claveCliente = this._claveCliente,
                     nip = this._nip
                 };
                 switch (this.codigoDesbloqueo)
                 {
                     case 0: req.tipoOperacion = ClavesOperacion.CodigoClienteDesbloqueo; break;
                     case 1: req.tipoOperacion = ClavesOperacion.TarjetaCredito; break;
                     case 2: req.tipoOperacion = ClavesOperacion.TarjetaDebito; break;
                     case 3: req.tipoOperacion = ClavesOperacion.NumeroCuenta; break;
                 }
                 validaAccesoBancaTelefonicaSuperNet(req, this._tipoNip);
                 break;
             default:
                 e.Error.message = TextosFront.frontMensajeActualmenteDesbloqueado;
                 if (validaAccesoBancaSuperTError != null)
                     validaAccesoBancaSuperTError(e.ErrorInMakingRequest, e.Error);
                 break;
         }
     }
     else
     {
         if (e.Error == null)
         {
             e.Error = new Error();
         }
         e.Error.message = TextosFront.frontMensajeErrorConexion;
         if (validaAccesoBancaSuperTError != null)
             validaAccesoBancaSuperTError(e.ErrorInMakingRequest, e.Error);
     }
 }
Example #53
0
        private void ResponseValidaNip(ServiceEventArgs<DtoValidarNip> e)
        {
            bool error = true;
            if (!e.ErrorInMakingRequest)
            {
                switch (e.Error.clave)
                {
                    case Errors.Generic.OK:
                        error = false;
                        this.TelefonoCelular = e.Dto.telefonoCelular;
                        this.CorreoElectronico = e.Dto.correoElectronico;
                        this._companiaCelularClave = e.Dto.companiaTelefonoCelular;

                        GetDiccionarioDatos();
                        break;
                    default:
                        break;
                }
            }

            if (error)
            {
                if (ProcesoError != null)
                {
                    this._dispatcher.BeginInvoke(() =>
                    {
                        ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = e.ErrorInMakingRequest, Error = e.Error });
                    });
                }
            }
        }
Example #54
0
        private void ResponseAfiliarSupermovil(ServiceEventArgs<string> e)
        {
            bool error = true;
            if (!e.ErrorInMakingRequest)
            {
                switch (e.Error.clave)
                {
                    case Errors.Generic.OK:
                        error = false;
                        if (null != AfiliarSupermovilComplete)
                        {
                            base._dispatcher.BeginInvoke(() =>
                            {
                                AfiliarSupermovilComplete();
                            });
                        }
                        break;
                    case Errors.Service.HIST0099:
                        this._afiliar = true;
                        error = false;
                        if (!this._isEnroled)
                        {
                            this._isEnroledMessage = false;
                            this._isEnroledMessageHist = true;
                        }
                        if (null != ProcesoError)
                        {
                            this._dispatcher.BeginInvoke(() =>
                            {
                                ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = error, Error = e.Error });
                            });
                        }
                        break;
                    default:
                        error = false;
                        if (null != ProcesoError)
                        {
                            this._dispatcher.BeginInvoke(() =>
                            {
                                ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = error, Error = e.Error });
                            });
                        }
                        break;
                }
            }

            if (error)
            {
                if (ProcesoError != null)
                {
                    this._dispatcher.BeginInvoke(() =>
                    {
                        ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = e.ErrorInMakingRequest, Error = e.Error });
                    });
                }
            }
        }
Example #55
0
        private void ResponseGetCatalogoImagenesPreguntas(ServiceEventArgs<DtoGetCatalogoImagenesPreguntas> e)
        {
            bool error = true;
            if (!e.ErrorInMakingRequest)
            {
                switch (e.Error.clave)
                {
                    case Errors.Generic.OK:
                        error = false;
                        this._imagenes.Clear();
                        if (null != e.Dto.imagenes) e.Dto.imagenes.ForEach((_) => { this._imagenes.Add(new ImagenItemViewModel(_)); });
                        if (null != e.Dto.preguntas) e.Dto.preguntas.ForEach((_) => { this._preguntas.Add(new PreguntaItemViewModel(_)); });
                        if (null != GetCatalogoImagenesPreguntasComplete)
                        {
                            base._dispatcher.BeginInvoke(() =>
                            {
                                GetCatalogoImagenesPreguntasComplete();
                            });
                        }
                        break;
                    default:
                        error = false;
                        if (null != ProcesoError)
                        {
                            this._dispatcher.BeginInvoke(() =>
                            {
                                ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = error, Error = e.Error });
                            });
                        }
                        break;
                }
            }

            if (error)
            {
                if (ProcesoError != null)
                {
                    this._dispatcher.BeginInvoke(() =>
                    {
                        ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = e.ErrorInMakingRequest, Error = e.Error });
                    });
                }
            }
        }
Example #56
0
            private void ResponseEliminarCuenta(ServiceEventArgs<DtoEliminarCuenta> e)
            {
                  bool error = true;
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              this.ReferenciaSupermovil = e.Dto.referencia;
                              error = false;
                        }
                  }

                  if (error) {
                        if (ProcesoError != null) {
                              this._dispatcher.BeginInvoke(() => {
                                    ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = e.ErrorInMakingRequest, Error = e.Error });
                              });
                        }
                  }
                  else {
                        if (EliminarCuentaComplete != null) {
                              this._dispatcher.BeginInvoke(() => {
                                    EliminarCuentaComplete();
                              });
                        }
                  }
            }
Example #57
0
            private void ResponseValidaToken(ServiceEventArgs e)
            {
                  bool error = true;
                  if (!e.ErrorInMakingRequest) {
                        if (e.Error.clave.Is(Errors.Generic.OK)) {
                              error = false;
                        }
                  }

                  if (error) {
                        if (ProcesoError != null) {
                              this._dispatcher.BeginInvoke(() => {
                                    ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = e.ErrorInMakingRequest, Error = e.Error });
                              });
                        }
                  }
                  else {
                        EliminarCuentaExistente();
                  }
            }
        private void responseGetDiccionarioDatos(ServiceEventArgs<List<string>> e)
        {
            if (!e.ErrorInMakingRequest)
            {
                if (e.Error.clave.Is(Errors.Generic.OK))
                {
                    this._diccionarioDatos = new List<string>(e.Dto);

                    if (validaAccesoBancaSuperTCompleted != null)
                    {
                        validaAccesoBancaSuperTCompleted(e.ErrorInMakingRequest, e.Error);
                    }
                }
                else
                {
                    if (validaAccesoBancaSuperTError != null)
                        validaAccesoBancaSuperTError(e.ErrorInMakingRequest, e.Error);
                }
            }
            else
            {
                if (validaAccesoBancaSuperTError != null)
                    validaAccesoBancaSuperTError(e.ErrorInMakingRequest, e.Error);
            }


        }
        private void responseValidaNipAsyncComplete2(ServiceEventArgs<DtoValidarNip> e)
        {
            bool error = false;
            if (!e.ErrorInMakingRequest)
            {
                if (e.Error.clave.Is(Errors.Generic.OK))
                {
                    Services.GetDiccionarioDeDatos(base.ServiceRequest, responseGetDiccionarioDatos);
                }
                else
                {
                    error = true;
                }
            }
            else
            {
                error = true;
            }

            if (error)
            {
                if (validaAccesoBancaSuperTError != null)
                    validaAccesoBancaSuperTError(e.ErrorInMakingRequest, e.Error);
            }

        }
Example #60
0
        private void ResponseGetCatalogoCompaniasCelular2(ServiceEventArgs<List<CompaniaCelular>> e)
        {
            bool error = true;
            if (!e.ErrorInMakingRequest)
            {
                switch (e.Error.clave)
                {
                    case Errors.Generic.OK:
                        error = false;
                        this._companiasCelulares.Clear();
                        e.Dto.ForEach((_) => { this._companiasCelulares.Add(new CompaniaCelularItemViewModel(_)); });
                        this.CompaniaCelular = this._companiasCelulares.Where(_ => _.NombreCompania.ToUpper().Equals(this._nombreCompaniaCelular)).FirstOrDefault();
                        if (null != GetCatalogoCompaniasCelular2Complete)
                        {
                            base._dispatcher.BeginInvoke(() =>
                            {
                                GetCatalogoCompaniasCelular2Complete();
                            });
                        }
                        break;
                    default:
                        error = false;
                        if (null != ProcesoError)
                        {
                            this._dispatcher.BeginInvoke(() =>
                            {
                                ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = error, Error = e.Error });
                            });
                        }
                        break;
                }
            }

            if (error)
            {
                if (ProcesoError != null)
                {
                    this._dispatcher.BeginInvoke(() =>
                    {
                        ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = e.ErrorInMakingRequest, Error = e.Error });
                    });
                }
            }
        }