public AdditionalChoose(List <object> items, string title, bool multipleSelection = false)
        {
            _multipleSelection = multipleSelection;

            InitializeComponent();

            Titlelabel.Content = title;
            Items = items;

            foreach (object item in Items)
            {
                AdditionalChooseItem chooseItem = new AdditionalChooseItem(item);
                chooseItem.Click += ChooseItem_Click;
                _chooseItems.Add(chooseItem);
                ItemsPanel.Children.Add(chooseItem);
            }

            ReadyButton.Clicked += (s, ea) =>
            {
                ReadyButtonClicked?.Invoke(this, EventArgs.Empty);
            };

            CancelButton.Clicked += (s, ea) =>
            {
                CancelButtonClicked?.Invoke(this, EventArgs.Empty);
            };
        }
Example #2
0
        public ChooseFiles(List <ConversationModel> conversations, List <FileModel> files)
        {
            _conversations = conversations;
            _files         = files;
            InitializeComponent();

            FileSortButton sortButton = (FileSortButton)LogicalTreeHelper.FindLogicalNode(this, "FileSortButton");

            FileList.BoundSortButton = sortButton;
            FileList.AllowSelect     = true;

            ReadyButton.Clicked += (s, ea) =>
            {
                SelectedFiles = FileList.SelectedFiles;
                ReadyButtonClicked?.Invoke(this, EventArgs.Empty);
            };

            CancelButton.Clicked += (s, ea) =>
            {
                CancelButtonClicked?.Invoke(this, EventArgs.Empty);
            };

            ConversationList.Clear();
            ConversationList.AddConversations(_conversations);

            ConversationList.SelectedConversationChanged += ConversationList_SelectedConversationChanged;

            if (ConversationList.Conversations.Any())
            {
                ConversationList.SelectedConversationItem = ConversationList.Conversations.First();
            }
        }
        public NewEmailMessage(ConversationModel conversation, MainWindow parent, string subject = "")
        {
            InitializeComponent();

            _parent = parent;

            if (_parent.EmailClients != null && _parent.EmailClients.Count > 0)
            {
                foreach (EmailModel email in _parent.EmailClients)
                {
                    EmailComboBox.AddItem(email.Address, email.Login != "" && !email.CannotConnect);
                }

                if (EmailComboBox.Items.Any(obj => obj.Enabled))
                {
                    EmailComboBox.SelectedItem = EmailComboBox.Items.First(obj => obj.Enabled);
                }
            }
            else
            {
                EmailComboBox.AddItem("Brak dostępnych adresów e-mail", false);
            }

            visibleIdLabel.Content = "(" + conversation.VisibleId + ")";
            titleBox.Text          = subject;
            messageBox.Text        = "";

            Loaded += (s, ea) =>
            {
                titleBox.Focusable = true;
                titleBox.Focus();
                Keyboard.Focus(titleBox);
            };

            ReadyButton.Clicked += (s, ea) =>
            {
                if (_parent.EmailClients != null && _parent.EmailClients.Count > 0 && EmailComboBox.SelectedItem != null)
                {
                    OutputSubject =
                        "(" + conversation.VisibleId + ")" + titleBox.Text;
                    SendingAddress = EmailComboBox.SelectedItem.Caption;
                    Message        = messageBox.Text;
                    ReadyButtonClicked?.Invoke(this, EventArgs.Empty);
                }
            };

            CancelButton.Clicked += (s, ea) =>
            {
                CancelButtonClicked?.Invoke(this, EventArgs.Empty);
            };

            AddFileFromDisk.Clicked    += AddFileFromDisk_Clicked;
            AddExistingFile.Clicked    += AddExistingFile_Clicked;
            AddFileFromScanner.Clicked += AddFileFromScanner_Clicked;

            _parent.DownloadClient.FileDownloaded += DownloadClient_FileDownloaded;
        }
Example #4
0
        private void Cancel_Button(object sender, RoutedEventArgs e)
        {
            if (loadedFilename != null && loadedFilename.IndexOf(Path.GetTempPath()) >= 0)
            {
                File.Delete(loadedFilename);
            }

            btnCancelButton?.Focus();
            CancelButtonClicked?.Invoke(this, e);
        }
Example #5
0
        public ChoosePerson(MainWindow parent, List <PersonModel> blockedPersons, bool multipleSelection = true, ChoosePersonMode chooseMode = ChoosePersonMode.ChoosePerson)
        {
            _parent = parent;

            _multipleSelection = multipleSelection;

            if (blockedPersons != null)
            {
                _blockedPersons = blockedPersons;
            }
            else
            {
                _blockedPersons = new List <PersonModel>();
            }

            InitializeComponent();

            if (_parent.ContactWorker.IsBusy)
            {
                _parent.ContactWorker.RunWorkerCompleted += ContactWorker_RunWorkerCompleted;;
            }
            else
            {
                if (_parent.Persons != null)
                {
                    _persons = _parent.Persons;
                }

                if (_parent.Companies != null)
                {
                    _companies = _parent.Companies;
                }

                InitializeContactList();
            }

            ReadyButton.Clicked += (s, ea) =>
            {
                if (SelectedPersons.Count > 0)
                {
                    ReadyButtonClicked?.Invoke(this, EventArgs.Empty);
                }
            };

            CancelButton.Clicked += (s, ea) =>
            {
                CancelButtonClicked?.Invoke(this, EventArgs.Empty);
            };

            _parent.NewCompanyArrived += _parent_NewCompanyArrived;
        }
Example #6
0
 private void btnClose_Click(object sender, RoutedEventArgs e)
 {
     if (_scannedImages.Any())
     {
         MessageBoxResult result = MessageBox.Show("Plik nie został zapisany. Czy na pewno chcesz wyjść?",
                                                   "Zapisywanie pliku", MessageBoxButton.YesNo);
         if (result == MessageBoxResult.Yes)
         {
             CancelButtonClicked?.Invoke(this, EventArgs.Empty);
         }
     }
     else
     {
         CancelButtonClicked?.Invoke(this, EventArgs.Empty);
     }
 }
        public NewEmailAddress(MainWindow parent)
        {
            _parent = parent;
            InitializeComponent();

            ReadyButton.Clicked  += ReadyButton_Clicked;
            CancelButton.Clicked += (s, ea) =>
            {
                CancelButtonClicked?.Invoke(this, EventArgs.Empty);
            };

            NoPasswordSaveCheckBox.SelectedChanged += (s, ea) =>
            {
                LoginTextBlock.Visibility    = NoPasswordSaveCheckBox.Selected ? Visibility.Collapsed : Visibility.Visible;
                PasswordTextBlock.Visibility = NoPasswordSaveCheckBox.Selected ? Visibility.Collapsed : Visibility.Visible;
            };
        }
Example #8
0
        public NewPhoneConversationMessage(MainWindow parent, ConversationModel conversation)
        {
            _parent       = parent;
            _conversation = conversation;

            InitializeComponent();

            CallAnsweredCheckBox.Selected = true;

            MessageTypeComboBox.AddItem("Rozmowa wykonana");
            MessageTypeComboBox.AddItem("Rozmowa odebrana");

            chooseSender.Text = "Wybierz odbiorcę";

            MessageTypeComboBox.SelectedItem = MessageTypeComboBox.Items[0];

            MessageTypeComboBox.SelectedItemChanged += MessageTypeComboBox_SelectedItemChanged;

            chooseSender.Clicked += ChooseSender_Clicked;

            ReadyButton.Clicked += (s, ea) =>
            {
                Message      = messageBox.Text;
                CallAnswered = CallAnsweredCheckBox.Selected;
                ReadyButtonClicked?.Invoke(this, EventArgs.Empty);
            };

            CancelButton.Clicked += (s, ea) =>
            {
                CancelButtonClicked?.Invoke(this, EventArgs.Empty);
            };

            AddFileFromDisk.Clicked    += AddFileFromDisk_Clicked;
            AddExistingFile.Clicked    += AddExistingFile_Clicked;
            AddFileFromScanner.Clicked += AddFileFromScanner_Clicked;

            _parent.DownloadClient.FileDownloaded += DownloadClient_FileDownloaded;
        }
 private void DoCancel()
 {
     _log.Debug("Doing cancel");
     CancelButtonClicked?.Invoke(this, new EventArgs());
     _ctSource.Cancel();
 }
Example #10
0
 private void CancelButton_Clicked(object sender, EventArgs e)
 {
     CancelButtonClicked?.Invoke(this, EventArgs.Empty);
 }
Example #11
0
 private void TaskOnClick()
 {
     CancelButtonClicked?.Invoke(this, new EventArgs());
 }
 private void cancelButton_Click(object sender, RoutedEventArgs e)
 {
     CopyNote(_externalNote, _internalNote);
     CancelButtonClicked?.Invoke(this, EventArgs.Empty);
 }
Example #13
0
 private void OnCancelButtonClicked()
 {
     CancelButtonClicked?.Invoke();
 }
Example #14
0
 private void Cancel_Button(object sender, RoutedEventArgs e)
 {
     btnCancelButton?.Focus();
     CancelButtonClicked?.Invoke(this, e);
 }