Exemplo n.º 1
0
        private void YouTubeCheckWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (SettingsManager.Configuration.PauseNotifications)
            {
                return;
            }
            IEnumerable <Database.Types.Video> unwatchedVideos = Database.Videos.GetAllUnwatched();

            if (unwatchedVideos.Count() > 0)
            {
                if ((bool)e.Result == false)
                {
                    LoggingManager.Log.Info($"There was an error checking for new videos, but there were {unwatchedVideos.Count()} unwatched videos found in the database.");
                }
                else
                {
                    LoggingManager.Log.Info($"{unwatchedVideos.Count()} unwatched videos were found.");
                }

                foreach (Database.Types.Video video in unwatchedVideos)
                {
                    NotificationForm newNotification = new NotificationForm(video);
                    newNotification.Show();
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// An order has been received an update containing critical modification of its information,
        /// so handle this here and show to user.
        /// </summary>
        void management_OrdersCriticalInformationChangedEvent(ITradeEntityManagement provider, AccountInfo account, Order order, OrderInfo updateInfo)
        {
            // Compose the critical update message instantly, as otherwise it is wrong since the order gets instantly updated after this call.
            string criticalUpdateMessage = string.Empty;

            if (order.OpenPrice.HasValue && updateInfo.OpenPrice.HasValue && order.OpenPrice.Value != updateInfo.OpenPrice.Value)
            {
                criticalUpdateMessage = string.Format("Open Price Difference [{0}], Existing [{1}], New [{2}].", order.OpenPrice - updateInfo.OpenPrice, order.OpenPrice.ToString(), updateInfo.OpenPrice) + Environment.NewLine;
            }

            if (order.ClosePrice.HasValue && updateInfo.ClosePrice.HasValue && order.ClosePrice.Value != updateInfo.ClosePrice.Value)
            {
                criticalUpdateMessage += string.Format("Close Price Difference [{0}], Existing [{1}], New [{2}].", order.ClosePrice - updateInfo.ClosePrice, order.ClosePrice.ToString(), updateInfo.ClosePrice) + Environment.NewLine;
            }

            WinFormsHelper.BeginManagedInvoke(this, delegate()
            {
                if (toolStripButtonPopupNotifications.Checked == false)
                {
                    return;
                }

                if (string.IsNullOrEmpty(criticalUpdateMessage) == false)
                {
                    string message         = "Account [" + account.Name + "] Order Id[" + order.Id + "] Critical Information Updated" + Environment.NewLine + criticalUpdateMessage;
                    NotificationForm form  = new NotificationForm();
                    form.labelMessage.Text = message;
                    form.Text    = "Critical Order Update";
                    form.TopMost = true;
                    form.Show();

                    //MessageBox.Show("Critical Order Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            });
        }
Exemplo n.º 3
0
        private void ShowNotification(object sender, EventArgs e)
        {
            if (notificationForm == null)
            {
                notificationForm             = new NotificationForm();
                notificationForm.FormClosed += NotificationFormClosed;
            }

            notificationForm.Show();
            notificationForm.BringToFront();
        }
Exemplo n.º 4
0
        public void AddAccout(AccountAddForm addAccountForm)
        {
            AccountForm <int> bankAccountForm  = new AccountForm <int>();
            NotificationForm  notificationForm = new NotificationForm( );

            try
            {
                bankAccountForm.Login               = addAccountForm.textBox_login.Text;
                bankAccountForm.Password            = addAccountForm.textBox_password.Text;
                bankAccountForm.RoleUserSystemAdmin = byte.Parse(addAccountForm.comboBox_roleSystem.SelectedIndex.ToString( ));
                bankAccountForm.RoleUser            = byte.Parse(addAccountForm.comboBox_roleUser.SelectedIndex.ToString( ));
                bankAccountForm.IdPerson            = getQuantityDirectoryFile.GetQuantityDataFile() - 1;
                bankAccountForm.Name1               = addAccountForm.textBox_name1.Text;
                bankAccountForm.Name2               = addAccountForm.textBox_name2.Text;
                bankAccountForm.Name3               = addAccountForm.textBox_name3.Text;
                //bankAccountForm.AdressCountry = addAccountForm.textBox_AdressCountry.Text;
                //bankAccountForm.AdressRegion = addAccountForm.textBox_AdressRegion.Text;
                //bankAccountForm.AdressPostcode = addAccountForm.textBox_AdressPostcode.Text;
                //bankAccountForm.AdressCity = addAccountForm.textBox_AdressCity.Text;
                //bankAccountForm.AdressStreet = addAccountForm.textBox_AdressStreet.Text;
                //bankAccountForm.AdressNumberHome = addAccountForm.textBox_AdressNumberHome.Text;
                //bankAccountForm.AdressNumberApartment = addAccountForm.textBox_AdressNumberApartment.Text;
                bankAccountForm.Email        = addAccountForm.textBox_Email.Text;
                bankAccountForm.PhoneNumber1 = addAccountForm.textBox_PhoneNumber1.Text;
                // bankAccountForm.Group = byte.Parse(addAccountForm.comboBox_Group.SelectedIndex.ToString());
                //bankAccountForm.Status = byte.Parse(addAccountForm.comboBox_Status.SelectedIndex.ToString());

                serializerClass.Serializ(bankAccountForm, constantClassData.FileNameBinary);

                notificationForm.ShowTextNotification("Успешное добавление данных!", "ОК!", Color.Green, Color.Green);
                notificationForm.Show( );
            }
            catch (Exception e)
            {
                notificationForm.ShowTextNotification("Произошла ошибка при добавлении данных!", e.ToString( ), Color.Red, Color.Green);
                notificationForm.Show( );
            }
        }
Exemplo n.º 5
0
        private void Notify(Control control)
        {
            if (Notification != null)
            {
                Queue(control);
                return;
            }

            Notification         = new NotificationForm(control, Application.Settings.NotificationHoldTime);
            Notification.Closed += delegate {
                Notification = null;
                Next();
            };

            Notification.Show(Application.MainForm);
        }
Exemplo n.º 6
0
 private void buttonNotification_Click(object sender, EventArgs e)
 {
     nF = new NotificationForm();
     nF.Show();
 }
Exemplo n.º 7
0
 // History
 private void Btn_history_Click(object sender, EventArgs e)
 {
     // TODO show History Form
     notificationForm.Show();
     // iH.Show();
 }