Ejemplo n.º 1
0
        protected void RemoveSelectedFromList(object obj)
        {
            MailActionSettings.AdditionalAttachments.Remove((string)obj);

            RaisePropertyChanged(nameof(AdditionalAttachmentsForTextBox)); //raus?
            RaisePropertyChanged(nameof(AdditionalAttachmentsDictionary));
            RaisePropertyChanged(nameof(AdditionalAttachments));

            AdditionalAttachmentsTokenViewModel.RaiseTextChanged();
        }
Ejemplo n.º 2
0
        private Option <string> SelectFileAction(string currentAttachment)
        {
            var title  = Translation.SelectFile;
            var filter = Interaction.Filter ?? Translation.AllFiles + " " + @"(*.*)|*.*";

            var interactionResult = _openFileInteractionHelper.StartOpenFileInteraction(currentAttachment, title, filter);

            interactionResult.MatchSome(s => { AdditionalAttachmentsTokenViewModel.RaiseTextChanged(); });

            return(interactionResult);
        }
Ejemplo n.º 3
0
        protected Option <string> AddFilePathToAdditionalAttachments(string filePathWithToken)
        {
            if (string.IsNullOrEmpty(filePathWithToken))
            {
                return(Option.Some(""));
            }

            if (!AdditionalAttachmentsDictionary.ContainsKey(filePathWithToken))
            {
                AdditionalAttachments.Add(filePathWithToken);
            }

            AdditionalAttachmentsForTextBox = "";

            RaisePropertyChanged(nameof(AdditionalAttachmentsForTextBox));
            RaisePropertyChanged(nameof(AdditionalAttachmentsDictionary));
            RaisePropertyChanged(nameof(AdditionalAttachments));

            AdditionalAttachmentsTokenViewModel.RaiseTextChanged();

            return(Option.Some(AdditionalAttachmentsForTextBox));
        }
Ejemplo n.º 4
0
        protected Option <string> SelectAttachmentFileAction(string s1)
        {
            var title  = Translation.SelectAttachmentTitle;
            var filter = Translation.AllFiles + " " + @"(*.*)|*.*";

            var interactionResult = _openFileInteractionHelper.StartOpenFileInteraction("", title, filter);

            interactionResult.MatchSome(s =>
            {
                if (!AdditionalAttachmentsDictionary.ContainsKey(s))
                {
                    AdditionalAttachments.Add(s);
                }

                RaisePropertyChanged(nameof(AdditionalAttachmentsForTextBox));
                RaisePropertyChanged(nameof(AdditionalAttachmentsDictionary));
                RaisePropertyChanged(nameof(AdditionalAttachments));

                AdditionalAttachmentsTokenViewModel.RaiseTextChanged();
            });

            return(Option.Some(AdditionalAttachmentsForTextBox ?? ""));
        }