arunselvakumar
12/28/2016 - 12:21 PM

CopyCommand.

CopyCommand.

        private void ExecuteCopyCommand(string copyText)
        {
            var clipBoardText = string.Empty;
            if (!string.IsNullOrEmpty(copyText))
            {
                switch (copyText)
                {
                    case "CopyAccount":
                        clipBoardText = string.Format("{0} ({1})", this.SelectedRecipient.AccountName, this.SelectedRecipient.AccountCode);
                    case "CopyContact":
                        clipBoardText = string.Format("{0} {1} ({2})", this.SelectedRecipient.ContactSalutationAndFirstName, this.SelectedRecipient.ContactLastName, this.SelectedRecipient.ContactCode);
                }
            }
            else
            {
                var accountInformation = string.Format("{0} ({1})", this.SelectedRecipient.AccountName, this.SelectedRecipient.AccountCode);
                var contactInformation = string.Format("{0} {1} ({2})", this.SelectedRecipient.ContactSalutationAndFirstName, this.SelectedRecipient.ContactLastName, this.SelectedRecipient.ContactCode);
                clipBoardText = string.Join(" ", accountInformation, contactInformation);
            }

            Clipboard.SetText(clipBoardText);
        }