public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
 {
     if (_autoStartup)
     {
         Start();
     }
 }
Пример #2
0
        static void myApplication_OnStartCreateMenu(object sender, ApplicationEventArgs e)
        {
            var myMenuModulo = Nampula.UI.Application.GetInstance().GetMenu(MenuID.cBoUIModulesMenu);

            var menu = new Nampula.UI.MenuItem("Lista de Empresas");

            var mnuTeste =
                new Nampula.UI.MenuItem(myMenuModulo, BoMenuType.mt_POPUP, "Nampula Teste");

            var mnuFormBind = new Nampula.UI.MenuItem(mnuTeste, BoMenuType.mt_STRING, "Form Binding");

            mnuFormBind.OnAfterClick += mnuFormBind_OnAfterClick;
            var mnuTesteForm =
                new Nampula.UI.MenuItem(mnuTeste, BoMenuType.mt_STRING, "Teste");

            mnuTesteForm.OnBeforeClick += mnuTesteForm_OnBeforeClick;

            var gridViewEditMenu = new Nampula.UI.MenuItem(mnuTeste, BoMenuType.mt_STRING, "GridView Editable Sample");

            gridViewEditMenu.OnBeforeClick += gridViewEditMenu_OnBeforeClick;

            var menuPayment = new Nampula.UI.MenuItem(mnuTeste, BoMenuType.mt_STRING, "Incoming Payment");

            new MenuItem(mnuTeste, BoMenuType.mt_STRING, "Grid Demo")
            .OnAfterClick += Program_OnAfterClick;

            menuPayment.OnBeforeClick += menuPayment_OnBeforeClick;

            FormSystemManager.Instance().AddFormWath(new BusinessPartnerForm());

            ApplicationSAP.GetInstance().CreateLogginMenu(mnuTeste);
        }
Пример #3
0
 private static void app_OnStartCreatMenu(object sender, ApplicationEventArgs e)
 {
     var moduloMenu = Nampula.UI.Application.GetInstance().GetMenu(MenuID.cBoUIModulesMenu);
     var menuGroup = new Nampula.UI.MenuItem(moduloMenu, BoMenuType.mt_POPUP,"Nampula Demo");
     var menuNampulaForm = new Nampula.UI.MenuItem(menuGroup, BoMenuType.mt_STRING, "teste");
         menuNampulaForm.OnAfterClick += menuNampulaForm_OnAfterClick;
 }
 public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
 {
     if (_endpoint is IApplicationEventListener)
     {
         ((IApplicationEventListener)_endpoint).HandleApplicationEvent(sender, e);
     }
 }
Пример #5
0
 public void OnApplicationEvent(ApplicationEventArgs args)
 {
     if (ApplicationEvent != null)
     {
         ApplicationEvent(args.Sender, args);
     }
 }
Пример #6
0
        void usr_TriggerApplicationEvent(ApplicationUserWrapper sender, ApplicationEventArgs e)
        {
            var userList = this.AppMan.AppUsers.ToList();

            userList.ForEach(user =>
            {
                user.Value.NextEvent = e;
            });
        }
Пример #7
0
        public void Add(ApplicationEventArgs e)
        {
            if (this.State != ESRState.Recording)
            {
                return;
            }

            this.ApplicationRecorder.Add(e);
        }
Пример #8
0
        /// <summary>
        /// Handles events raised by an application context.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void OnContextEvent(object sender, ApplicationEventArgs e)
        {
            ContextEventArgs cea = e as ContextEventArgs;

            if (cea != null &&
                cea.Event == ContextEventArgs.ContextEvent.Closed &&
                sender is IApplicationContext)
            {
                // we know the context is registered!
                UnregisterContext((IApplicationContext)sender);
            }
        }
Пример #9
0
        public void Add(ApplicationEventArgs e)
        {
            IRecorderItem newRecorder = null;

            newRecorder = new ApplicationRecorderItem()
            {
                ApplicationData = e.ApplicationData,
                Event           = e.Event,
            };

            this.ESRRecorder.AddItem(newRecorder);
            this.ESRRecorder.CurrentRecorder = newRecorder;
        }
Пример #10
0
        static void myApplication_OnStartConnection(object sender, ApplicationEventArgs e)
        {
            var param = Nampula.UI.Application.GetInstance().GetParam();

            //param.ConnectionTimeout = 240;

            WaitingStatusHelper.WaintigFor(() => new DBTeste().Start(param), "Teste de Mensagem");

            var teste = B1Helper.GetByKey <BusinessPlace>(GetCurrentCompanyDb(), 1, "Business Place");

            //var item = B1Helper.GetItem("P00002", GetCurrentCompanyDb());

            //var cod = B1Helper.GetByKey<BrazilFuelIndexer>(GetCurrentCompanyDb(), item.FuelCode, "Configuração de Combustível");

            //new Security( );

            //var draft2 = B1Helper.GetDocument(4, eDocumentObjectType.oPurchaseOrders, Program.GetCurrentCompanyDb());

            //draft2.FillTaxExtension();

            //Debug.Assert(draft2.TaxExtension.MainUsage.Equals("11"),  "Utilização deveria ser 11 - 1411 - Dev. Cmp Cons");

            //draft2.FillLines();

            //var draft = B1Helper.GetDocument(15, eDocumentObjectType.oDrafts, Program.GetCurrentCompanyDb());

            //draft.FillLines();

            //var draft2 = B1Helper.GetDocument(1, eDocumentObjectType.oInvoices, Program.GetCurrentCompanyDb());
            //draft2.FillLines();

            //var draft3 = B1Helper.GetDocument(2, eDocumentObjectType.oInvoices, Program.GetCurrentCompanyDb());
            //draft3.FillLines();

            //var items = B1Helper.GetAll<Item>(Program.GetCurrentCompanyDb(),
            //    new KeyValuePair<string, object>(Item.FieldsName.CodeBars, "1212121212"));

            //if (items.IsEmpty())
            //{
            //    var codeBars = B1Helper.GetAll<BarCodeMasterData>(Program.GetCurrentCompanyDb(),
            //        new KeyValuePair<string, object>(BarCodeMasterData.FieldsName.BcdCode, "1212121212"));

            //    items = codeBars.Select(c =>
            //        B1Helper.GetByKey<Item>(GetCurrentCompanyDb(), c.ItemCode)).ToList();
            //}

            //var draft3 = B1Helper.GetDocument(2, eDocumentObjectType.oInvoices, Program.GetCurrentCompanyDb());
            //draft3.FillLines();
        }
 /// <summary>
 /// Handles the application context's refresh event and starts the scheduler.
 /// </summary>
 public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
 {
     // auto-start Scheduler if demanded
     if (e is ContextRefreshedEventArgs && autoStartup)
     {
         try
         {
             StartScheduler(scheduler, startupDelay);
         }
         catch (SchedulerException ex)
         {
             throw new ObjectInitializationException("failed to auto-start scheduler", ex);
         }
     }
 }
Пример #12
0
 public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
 {
     if (_eventTypes == null || _eventTypes.Count == 0)
     {
         SendEventAsMessage(e);
         return;
     }
     foreach (Type type in _eventTypes)
     {
         if (type.IsAssignableFrom(e.GetType()))
         {
             SendEventAsMessage(e);
             return;
         }
     }
 }
        public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
        {
            var eventArgs = e as ContextRefreshedEventArgs;

            if (eventArgs == null)
            {
                return;
            }

            var args = eventArgs;

            if (args.Event != ContextEventArgs.ContextEvent.Refreshed)
            {
                return;
            }

            var ctx          = (IApplicationContext)sender;
            var eventService = (IEventService)ctx.GetObject("EventService");

            eventService.RegisterEvents();
        }
        /// <summary>
        /// Publishes an application context event.
        /// </summary>
        /// <remarks>
        /// <p>
        /// 
        /// </p>
        /// </remarks>
        /// <param name="sender">
        /// The source of the event. May be <see langword="null"/>.
        /// </param>
        /// <param name="e">
        /// The event that is to be raised.
        /// </param>
        /// <seealso cref="Spring.Context.IApplicationEventPublisher.PublishEvent"/>
        public void PublishEvent(object sender, ApplicationEventArgs e)
        {
            #region Instrumentation

            if (log.IsDebugEnabled)
            {
                log.Debug(string.Format(
                              CultureInfo.InvariantCulture,
                              "Publishing event in context [{0}] : {1}",
                              Name, e));
            }

            #endregion

            OnContextEvent(sender, e);

            if (ParentContext != null)
            {
                ParentContext.PublishEvent(sender, e);
            }
        }
			public void PublishEvent(object sender, ApplicationEventArgs e)
			{
				throw new NotImplementedException();
			}
Пример #16
0
 private static void app_OnStartConnection(object sender, ApplicationEventArgs e)
 {
     new DBNampula().Start(Nampula.UI.Application.GetInstance().GetParam());
 }
Пример #17
0
        public void TriggerEvent(string eventName, object data)
        {
            ApplicationEventArgs args = new ApplicationEventArgs(this, eventName, data);

            this.user.OnTriggerApplicationEvent(args);
        }
 public void PublishEvent(object sender, ApplicationEventArgs e)
 {
     throw new NotImplementedException();
 }
Пример #19
0
 private bool SendEventAsMessage(ApplicationEventArgs @event)
 {
     return(SendMessage(MessageBuilder.WithPayload(@event).Build()));
 }
Пример #20
0
 /// <summary>
 /// Handles events raised by an application context.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void OnContextEvent(object sender, ApplicationEventArgs e)
 {
     ContextEventArgs cea = e as ContextEventArgs;
     if (cea != null
         && cea.Event == ContextEventArgs.ContextEvent.Closed
         && sender is IApplicationContext)
     {
         // we know the context is registered!
         UnregisterContext((IApplicationContext)sender);
     }
 }
Пример #21
0
 /// <summary>
 /// Handle an application event.
 /// </summary>
 /// <param name="sender">
 /// The source of the event.
 /// </param>
 /// <param name="e">
 /// The event that is to be handled.
 /// </param>
 public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
 {
     Console.WriteLine("Source      : " + sender);
     Console.WriteLine("Event fired : " + e.TimeStamp);
 }
		/// <summary>
		/// Handle an application event.
		/// </summary>
		/// <param name="sender">
		/// The source of the event.
		/// </param>
		/// <param name="e">
		/// The event that is to be handled.
		/// </param>
		public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
		{
			Console.WriteLine("Source      : " + sender);
			Console.WriteLine("Event fired : " + e.TimeStamp);
		}
Пример #23
0
 private void DeepThoughtApp_Closed(object sender, ApplicationEventArgs e)
 {
     AppDisconnected?.Invoke(this, EventArgs.Empty);
 }
Пример #24
0
 static void myApplication_OnShutDown(object sender, ApplicationEventArgs e)
 {
     System.Windows.Forms.Application.Exit();
 }
 /// <summary>
 /// Raises an application context event.
 /// </summary>
 /// <param name="e">
 /// Any arguments to the event. May be <see langword="null"/>.
 /// </param>
 protected virtual void OnContextEvent(ApplicationEventArgs e)
 {
     OnContextEvent(this, e);
 }
 /// <summary>
 /// Raises an application context event.
 /// </summary>
 /// <param name="source">
 /// The source of the event.
 /// </param>
 /// <param name="e">
 /// Any arguments to the event. May be <see langword="null"/>.
 /// </param>
 protected virtual void OnContextEvent(object source, ApplicationEventArgs e)
 {
     IEventExceptionsCollector exceptions = _eventRaiser.Raise(ContextEvent, source, e);
     if (exceptions.HasExceptions)
     {
         Delegate target = ContextEvent.GetInvocationList()[0];
         Exception exception = (Exception)exceptions[target];
         throw new ApplicationContextException(string.Format("An unhandled exception occured during processing application event {0} in handler {1}", e.GetType(), target.Method), exception);
     }
 }
Пример #27
0
 static void app_ApplicationFinished(object sender, ApplicationEventArgs e)
 {
     semaphore.Set();
 }