Exemplo n.º 1
0
        private void primaryFileListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            SizeOfFile.FillFileSizeTextBox();
            if (primaryFileListBox.SelectedItem == null)
            {
                return;
            }
            string selectedItem = primaryFileListBox.SelectedItem.ToString().ToLower();

            if (selectedItem.EndsWith(".enc"))
            {
                encryptionButton.Text = "Decryption";
            }
            else
            {
                encryptionButton.Text = "Encryption";
            }
        }
Exemplo n.º 2
0
        public PressRelease WithSizeOfFile(SizeOfFile fileType, string url)
        {
            switch (fileType)
            {
            case SizeOfFile.Image:
                this.SizeOfImageByAnnouncement = Helper.GetContentLengthByLink(url);
                break;

            case SizeOfFile.WatchPDF:
                this.SizeOfFileToWatchPDF = Helper.GetContentLengthByLink(url);
                break;

            case SizeOfFile.DownloadPDF:
                this.SizeOfFileToDownloadPDF = Helper.GetContentLengthByLink(url);
                break;
            }

            return(this);
        }
Exemplo n.º 3
0
        public List <PressRelease> PressReleasesWithSizeOfElement(string xpath, string attribute, SizeOfFile fileType)
        {
            var pressRelease = this.PressReleasesWithId();

            var pressReleasesTab = WDriver.GetDriver().FindElements(By.XPath("//div[@role='tablist']")).ToList();

            for (int i = 0; i < pressReleasesTab.Count; i++)
            {
                var elementsWithUrl = pressReleasesTab.ElementAt(i).FindElements(By.XPath(string.Format(xpath, i + 1)));

                if (elementsWithUrl.Count != 0)
                {
                    var url = elementsWithUrl.First().GetAttribute(attribute);

                    pressRelease.ElementAt(i).WithSizeOfFile(fileType, url);
                }
            }

            return(pressRelease);
        }