Example #1
0
        [Test] // ctor (LinkLabel)
        public void Constructor1()
        {
            LinkLabel l = new LinkLabel();

            l.Text = "Managed Windows Forms";

            LinkLabel.LinkCollection links1 = new LinkLabel.LinkCollection(
                l);
            LinkLabel.LinkCollection links2 = new LinkLabel.LinkCollection(
                l);

            Assert.AreEqual(1, links1.Count, "#A1");
            Assert.IsFalse(links1.IsReadOnly, "#A2");
#if NET_2_0
            Assert.IsFalse(links1.LinksAdded, "#A3");
#endif

            LinkLabel.Link link = links1 [0];
#if NET_2_0
            Assert.IsNull(link.Description, "#B1");
#endif
            Assert.IsTrue(link.Enabled, "#B2");
            Assert.AreEqual(21, link.Length, "#B3");
            Assert.IsNull(link.LinkData, "#B4");
#if NET_2_0
            Assert.IsNotNull(link.Name, "#B5");
            Assert.AreEqual(string.Empty, link.Name, "#B6");
#endif
            Assert.AreEqual(0, link.Start, "#B7");
#if NET_2_0
            Assert.IsNull(link.Tag, "#B8");
#endif
            Assert.IsFalse(link.Visited, "#B9");

            Assert.AreEqual(1, links2.Count, "#C1");
            Assert.IsFalse(links2.IsReadOnly, "#C2");
#if NET_2_0
            Assert.IsFalse(links2.LinksAdded, "#C3");
#endif
            Assert.AreSame(link, links2 [0], "#C4");
        }
Example #2
0
        [Test] // bug #344012
        public void InvalidateManualLinks()
        {
            Form form = new Form();

            form.ShowInTaskbar = false;

            LinkLabel l = new LinkLabel();

            l.Text = "linkLabel1";
            form.Controls.Add(l);

#if NET_2_0
            LinkLabel.Link link = new LinkLabel.Link(2, 5);
            l.Links.Add(link);
#else
            l.Links.Add(2, 5);
#endif

            form.Show();
            form.Dispose();
        }
Example #3
0
        private void ShowLatestRelease(string latestRelease, string latestReleaseUrl)
        {
            if (IsDisposed)
            {
                return;
            }
            if (InvokeRequired)
            {
                Invoke(new Action <string, string>(ShowLatestRelease), new object[] { latestRelease, latestReleaseUrl });
                return;
            }

            lblNewReleaseAvailable.Text = $"{Properties.Strings.Label_NewVersionAvailable} ({latestRelease})";
            var link = new LinkLabel.Link
            {
                LinkData = latestReleaseUrl
            };

            lblNewReleaseAvailable.Links.Add(link);
            lblNewReleaseAvailable.Visible = true;
        }
        private void displayCurrentAppointment()
        {
            Appointment currentAppointment = loadAppointmentDetails();

            this.lblDescription.Text = currentAppointment.Description;
            this.lblTitle.Text       = currentAppointment.Title;

            this.lnkLblUrl.Links.Clear();
            this.lnkLblUrl.Text = currentAppointment.Url;

            LinkLabel.Link link = new LinkLabel.Link();
            link.LinkData = currentAppointment.Url;

            this.lnkLblUrl.Links.Add(link);

            this.picImage.Image           = currentAppointment.Image;
            this.lblPlace.Text            = currentAppointment.Place;
            this.lblFooter.Text           = currentAppointment.Footer;
            this.lblAppointmentCount.Text = "Termin " + (currentAppointmentIndex + 1).ToString() + " von " + appointmentDirectories.Count.ToString();
            this.lblRememberedCount.Text  = "Gemerkt: " + Directory.EnumerateDirectories("chooser/interesting").Count().ToString();
        }
        private void SetupLabel()
        {
            Label.Links.Clear();
            StringBuilder sb = new StringBuilder();

            Point[] links   = new Point[verbs.Length];
            int     charLoc = 0;

            for (int i = 0; i < verbs.Length; i++)
            {
                if (verbs[i].Visible)
                {
                    if (i > 0)
                    {
                        sb.Append(", ");
                        charLoc += 2;
                    }

                    string name = verbs[i].Text;

                    links[i] = new Point(charLoc, name.Length);
                    sb.Append(name);
                    charLoc += name.Length;
                }
            }

            Label.Text = sb.ToString();

            for (int i = 0; i < verbs.Length; i++)
            {
                if (verbs[i].Visible)
                {
                    LinkLabel.Link link = Label.Links.Add(links[i].X, links[i].Y, verbs[i]);
                    if (!verbs[i].Enabled)
                    {
                        link.Enabled = false;
                    }
                }
            }
        }
        private void frmTool_Load(object sender, EventArgs e)
        {
            this.Text = lblTitle.Text;

            if (true)
            {
                txtPath.Text = System.Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents";
            }

            if (File.Exists(configFile))
            {
                txtPath.Text = File.ReadAllText(configFile);
            }
            else
            {
                WriteConfig();
            }

            ttPath = new ToolTip();
            ttPath.AutoPopDelay = 0;
            ttPath.InitialDelay = 500;
            ttPath.ReshowDelay  = 500;
            ttPath.ShowAlways   = true;
            ttPath.SetToolTip(txtPath, txtPath.Text);

            var twitterUrl = new LinkLabel.Link();

            twitterUrl.LinkData = "https://twitter.com/XO_Khaos";
            linkTwitter.Links.Add(twitterUrl);

            var twitchUrl = new LinkLabel.Link();

            twitchUrl.LinkData = "https://www.twitch.tv/xo_khaos";
            linkTwitch.Links.Add(twitchUrl);

            var howToUrl = new LinkLabel.Link();

            howToUrl.LinkData = "https://github.com/XOCODE-OP/Quick_Lazy_Game_Details";
            linkHowTo.Links.Add(howToUrl);
        }
        public AboutDialog()
        {
            InitializeComponent();
            Version version = AssemblyVersion;

            Text = $"About {AssemblyTitle}";
            labelProductName.Text = AssemblyTitle;
            labelVersion.Text     = $@"v{version.Major}.{version.Minor} ({"build"} {version.Build})";
            labelCopyright.Text   = $"{AssemblyCopyright} {Encoding.ASCII.GetString(Convert.FromBase64String(""))}";
            tableLayoutPanel.ColumnStyles[0].Width = labelProductName.Width + 8;
            var hl = new LinkLabel.Link {
                Description = "desc"
            };

            hl.LinkData             = hl.Name = "http://code.google.com/p/transmission-remote-dotnet";
            hl.Start                = labelHomepageLink.Text.Length + 1;
            hl.Length               = hl.Name.Length;
            labelHomepageLink.Text += " " + hl.Name;
            labelHomepageLink.Links.Add(hl);
            bool first = true;

            foreach (KeyValuePair <string, string> c in _coders)
            {
                var l = new LinkLabel.Link
                {
                    Description = "desc",
                    LinkData    = Encoding.ASCII.GetString(Convert.FromBase64String(c.Value))
                };
                l.Name = $"{c.Key}";
                if (!first)
                {
                    labelDevelopers.Text += ",";
                }
                l.Start               = labelDevelopers.Text.Length + 1;
                l.Length              = l.Name.Length;
                labelDevelopers.Text += " " + l.Name;
                labelDevelopers.Links.Add(l);
                first = false;
            }
        }
Example #8
0
        private void InitInterface()
        {
            LinkLabel.Link l = new LinkLabel.Link();
            l.LinkData = "https://wikileaks.org/wiki/Alternative_DNS";
            link.Links.Add(l);

            //Liste les interfaces

            /*
             * foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
             *  listInterface.Add(new Interface { Id = nic.Id, Name = nic.Name });
             */

            ListInterfaces();
            cb_interfaces.Items.AddRange(listInterface.ToArray());


            //Charge et liste les services DNS
            StreamReader sr = new StreamReader("dns.csv");

            sr.ReadLine(); //Ignore les headers

            String line;

            while ((line = sr.ReadLine()) != null)
            {
                String[] tab = line.Split(';');

                listDns.Add(new ServiceDns
                {
                    Name        = tab[0],
                    PrimaryIP   = IPAddress.Parse(tab[1]),
                    SecondaryIP = IPAddress.Parse(tab[2]),
                    Description = tab[3].Replace("- ", Environment.NewLine + "- ")
                });
            }

            cb_predefinedDNS.Items.AddRange(listDns.ToArray());
        }
Example #9
0
        private async void Form1_Load(object sender, EventArgs e)
        {
            //On Form Load
            LinkLabel.Link link = new LinkLabel.Link();
            link.LinkData = "https://r4p3.net/";
            linkLabel1.Links.Add(link);
            linkLabel2.Links.Add(link);
            linkLabel3.Links.Add(link);
            linkLabel4.Links.Add(link);
            linkLabel5.Links.Add(link);
            //LinkLabel Links

            materialSingleLineTextField5.Text = SaveLocation;
            if (Directory.Exists(CacheFolder) && CacheFolder != null && CacheFolder != "")
            {
                await UpdateignoreArray(ignoreArrayString);
            }
            else
            {
                getTeamsSpeakFolder();
            }
        }
        private void SetupLabel()
        {
            this.Label.Links.Clear();
            StringBuilder builder = new StringBuilder();

            Point[] pointArray = new Point[this.verbs.Length];
            int     x          = 0;
            bool    flag       = true;

            for (int i = 0; i < this.verbs.Length; i++)
            {
                if (this.verbs[i].Visible && this.verbs[i].Supported)
                {
                    if (!flag)
                    {
                        builder.Append(Application.CurrentCulture.TextInfo.ListSeparator);
                        builder.Append(" ");
                        x += 2;
                    }
                    string text = this.verbs[i].Text;
                    pointArray[i] = new Point(x, text.Length);
                    builder.Append(text);
                    x   += text.Length;
                    flag = false;
                }
            }
            this.Label.Text = builder.ToString();
            for (int j = 0; j < this.verbs.Length; j++)
            {
                if (this.verbs[j].Visible && this.verbs[j].Supported)
                {
                    LinkLabel.Link link = this.Label.Links.Add(pointArray[j].X, pointArray[j].Y, this.verbs[j]);
                    if (!this.verbs[j].Enabled)
                    {
                        link.Enabled = false;
                    }
                }
            }
        }
Example #11
0
        /// <summary>
        /// Load link and license text.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AboutForm_Load(object sender, EventArgs e)
        {
            const string WEB_LINK     = "http://www.lungStruck.com/projects/pc-meter";
            const string LICENSE_TEXT = @"Copyright (c) Scott W. Vincent, 2013
All rights reserved.
            
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
            
  - Redistributions of source code must retain the above copyright notice, this list of conditions and the
    following disclaimer.

  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
    following disclaimer in the documentation and/or other materials provided with the distribution.
        
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";

            pcMeterLinkLabel.Text = WEB_LINK;
            LinkLabel.Link link = new LinkLabel.Link();
            link.LinkData = WEB_LINK;
            pcMeterLinkLabel.Links.Add(link);
            licenseTextBox.Text = LICENSE_TEXT;
        }
        public formCreditos(bool conectado)
        {
            InitializeComponent();
            MaterialSkinManager m = MaterialSkinManager.Instance;

            m.AddFormToManage(this);
            m.Theme = MaterialSkinManager.Themes.LIGHT;
            if (conectado)
            {
                m.ColorScheme = new ColorScheme(Primary.Green400, Primary.Green300, Primary.Green200, Accent.Green100, TextShade.WHITE);
            }
            else
            {
                m.ColorScheme = new ColorScheme(Primary.Red800, Primary.Red700, Primary.Red600, Accent.Red400, TextShade.WHITE);
            }

            LinkLabel.Link linkDiscord = new LinkLabel.Link();
            linkDiscord.LinkData = "https://discord.gg/q6hdKc8";
            LinkLabel.Link linkRadikal = new LinkLabel.Link();
            linkRadikal.LinkData = "http://www.radikal-gamez.net/forums/juegos-switch.196/";
            linkLabel2.Links.Add(linkRadikal);
        }
Example #13
0
        public Form1()
        {
            InitializeComponent();

            this.Text = raw_title;

            save_hex_status();
            save_dec_status();

            RestoreMemo();
            display_error_message(false);

            LinkLabel.Link link = new LinkLabel.Link();
            this.linkLabel1.Text = "PCHSU's HexCalor";
            link.LinkData        = "http://pc-hsu.blogspot.tw/2018/02/hex-operation.html";
            linkLabel1.Links.Add(link);

            SaveMemoTimer          = new System.Windows.Forms.Timer();
            SaveMemoTimer.Tick    += new EventHandler(TimerEven_SaveMemoTimer);
            SaveMemoTimer.Interval = 5000;
            SaveMemoTimer.Start();

            Periodic_Timer          = new System.Windows.Forms.Timer();
            Periodic_Timer.Tick    += new EventHandler(TimerEven_PeriodTimer);
            Periodic_Timer.Interval = 100;
            Periodic_Timer.Start();

            this.textBox6.Text = "Select : " + "None";

            for (int i = 1; i < 32; i++)
            {
                this.comboBox2.Items.Add(i.ToString());
            }
            comboBox2.SelectedIndex = 0;


            set_to_zero();
        }
Example #14
0
        [Test]         // Add (LinkLabel.Link)
        public void Add1()
        {
            LinkLabel l = new LinkLabel();

            l.Text = "Managed Windows Forms";

            LinkLabel.LinkCollection links1 = new LinkLabel.LinkCollection(
                l);
            LinkLabel.LinkCollection links2 = new LinkLabel.LinkCollection(
                l);

            LinkLabel.Link linkA = new LinkLabel.Link(0, 7);
            Assert.AreEqual(0, links1.Add(linkA), "#A1");
            Assert.AreEqual(1, links1.Count, "#A2");
            Assert.AreEqual(1, links2.Count, "#A3");
            Assert.IsTrue(links1.LinksAdded, "#A4");
            Assert.IsFalse(links2.LinksAdded, "#A5");
            Assert.AreSame(linkA, links1 [0], "#A6");
            Assert.AreSame(linkA, links2 [0], "#A7");

            LinkLabel.Link linkB = new LinkLabel.Link(8, 7);
            Assert.AreEqual(1, links1.Add(linkB), "#B1");
            Assert.AreEqual(2, links1.Count, "#B2");
            Assert.AreEqual(2, links2.Count, "#B3");
            Assert.IsTrue(links1.LinksAdded, "#B4");
            Assert.IsFalse(links2.LinksAdded, "#B5");
            Assert.AreSame(linkA, links1 [0], "#B6");
            Assert.AreSame(linkA, links2 [0], "#B7");
            Assert.AreSame(linkB, links1 [1], "#B8");
            Assert.AreSame(linkB, links2 [1], "#B9");

            LinkLabel.LinkCollection links3 = new LinkLabel.LinkCollection(
                l);
            Assert.AreEqual(2, links3.Count, "#C1");
            Assert.IsFalse(links3.LinksAdded, "#C2");
            Assert.AreSame(linkA, links3 [0], "#C3");
            Assert.AreSame(linkB, links3 [1], "#C4");
        }
        // Called when the user clicks a method name in the crumbBar.  This
        // selects the corresponding Record/Row in TheListView.
        private void SelectRowForCrumbBarLink(LinkLabel.Link clickedLink)
        {
            try {
                // Don't build a new crumbBar when we change the currently seleted row.
                _keepCrumbBar = true;

                // The stack origin (last entry in the stack, last link in the crumbBar) is
                // special because that linkRecord may be a Record that is expanded into
                // multiple Rows, and we need to select the right one of those Rows.
                Record linkRecord = (Record)clickedLink.LinkData;

                if (linkRecord == _crumbBarRow.Rec)
                {
                    MainForm.TheMainForm.SelectRowIndex(_crumbBarRow.Index);
                }
                else
                {
                    MainForm.TheMainForm.SelectRowIndex(linkRecord.RowIndices[0]);
                }

                if (_visited != null)
                {
                    _visited.Enabled = true;
                }

                // Disable links for invisible records.
                //foreach (LinkLabel.Link link in linkLabel1.Links) {
                //    linkRecord = link.LinkData as Record;
                //    if (linkRecord != null) link.Enabled = linkRecord.IsVisible;
                //}

                // Disable the link for the record we just selected.
                clickedLink.Enabled = false;
                _visited            = clickedLink;
            } finally {
                _keepCrumbBar = false;
            }
        }
        private void textBoxSteamID64_New_TextChanged(object sender, EventArgs e)
        {
            textBoxSteamID64_New.Text = Regex.Replace(textBoxSteamID64_New.Text, @"[^\d]", "");

            if (UInt64.TryParse(textBoxSteamID64_New.Text, out UInt64 unused) == true)
            {
                toolStripStatusLabel1.Text = lastStatus;

                if (textBoxSteamID64_New.Text.Length > 0)
                {
                    // Update the Steam Community link
                    linkLabelSteamID64_New.Links.Clear();
                    LinkLabel.Link linkSteamCommunityProfile_New = new LinkLabel.Link(0, 0, "http://steamcommunity.com/profiles/" + textBoxSteamID64_New.Text);
                    linkLabelSteamID64_New.Links.Add(linkSteamCommunityProfile_New);
                    linkLabelSteamID64_New.Enabled = true;
                }
                else
                {
                    linkLabelSteamID64_New.Links.Clear();
                    linkLabelSteamID64_New.Enabled = false;
                }

                // Check if a current file is loaded
                if (String.IsNullOrWhiteSpace(textBoxSteamID64_New.Text) == false && String.IsNullOrWhiteSpace(filePath) == false && textBoxSteamID64_New.Text != textBoxSteamID64.Text)
                {
                    buttonUpdate.Enabled = true;
                }
                else
                {
                    buttonUpdate.Enabled = false;
                }
            }
            else
            {
                buttonUpdate.Enabled           = false;
                linkLabelSteamID64_New.Enabled = false;
            }
        }
Example #17
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filter      = "Excel files | *.xls;*.xlsx"; // file types, that will be allowed to upload
            dialog.Multiselect = false;                        // allow/deny user to upload more than one file at a time
            if (dialog.ShowDialog() == DialogResult.OK)        // if user clicked OK
            {
                button1.Visible = false;
                String path = dialog.FileName; // get name of file
                //using (StreamReader reader = new StreamReader(new FileStream(path, FileMode.Open), new UTF8Encoding())) // do anything you want, e.g. read it
                //{

                //}
                string result = Path.GetTempFileName().Replace("\\", "/").Replace(".tmp", ".xlsx");
                facturacionCtrl.procesaFacturacion(path, result);
                LinkLabel.Link lnk = new LinkLabel.Link();
                lnk.LinkData = "http://cascserver.ddns.net:82";
                linkLabel1.Links.Add(lnk);
                linkLabel1.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabel1_LinkClicked);
                linkLabel1.Visible      = true;
            }
        }
Example #18
0
 private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
 {
     if (linkLabel1.Text == "<*****@*****.**>")
     {
         label1.Text     = "BOOTMGR";
         linkLabel1.Text = "github.com/BOOTMGR";
         linkLabel1.Links.Clear();
         LinkLabel.Link link = new LinkLabel.Link();
         link.LinkData = "http://www.github.com/BOOTMGR";
         linkLabel1.Links.Add(link);
         pictureBox1.Image = (Image)RAM_Cleaner_2.Properties.Resources.avatar;
     }
     else
     {
         label1.Text     = "Harsh Panchal";
         linkLabel1.Text = "<*****@*****.**>";
         linkLabel1.Links.Clear();
         LinkLabel.Link link = new LinkLabel.Link();
         link.LinkData = "mailto:[email protected]";
         linkLabel1.Links.Add(link);
         pictureBox1.Image = (Image)RAM_Cleaner_2.Properties.Resources.free_ram1;
     }
 }
Example #19
0
        /**************************************************************************************************/
        #region //// About information //////////////////////////////////////
        private void LoadAboutData()
        {
            lblVersion.Text += "Publish version: " + VersionData.PublishVersionSt;
            lblVersion.Text += Environment.NewLine + "Assembly version: " + VersionData.AssemblyVersionSt;
            lblVersion.Text += Environment.NewLine + "File version: " + VersionData.FileVersionSt;
            //lblVersion.Text += Environment.NewLine + "Product version " + ProductVersionSt;

            //MessageBox.Show("Application " + assemName.Name + ", Version " + ver.ToString());
            lblVersion.Text += Environment.NewLine + "Compile time: " + VersionData.CompileTime.ToString("yyyy-MM-dd HH:mm:ss");

            // Add link
            LinkLabel.Link link = new LinkLabel.Link();
            link.LinkData = "http://www.astromania.info/";
            linkAstromania.Links.Add(link);

            LinkLabel.Link link2 = new LinkLabel.Link();
            link2.LinkData = "http://astrohostel.ru/";
            linkAstrohostel.Links.Add(link2);

            LinkLabel.Link link3 = new LinkLabel.Link();
            link3.LinkData = "http://astro.milantiev.com/";
            linkMilantiev.Links.Add(link3);
        }
Example #20
0
        private async void FormMain_Load(object sender, EventArgs e)
        {
            Text     = "Irregulator " + Application.ProductVersion;
            Location = settings.WindowLocation;
            if (settings.WindowSize.Width >= MinimumSize.Width && settings.WindowSize.Height >= MinimumSize.Height)
            {
                Size = settings.WindowSize;
            }
            if (settings.WindowMaximized)
            {
                WindowState = FormWindowState.Maximized;
            }

            Octokit.GitHubClient gitHubClient = new Octokit.GitHubClient(new Octokit.ProductHeaderValue("Irregulator"));
            gitHubClient.SetRequestTimeout(new TimeSpan(0, 2, 0));
            try
            {
                Octokit.Release release = await gitHubClient.Repository.Release.GetLatest("JKAnderson", "Irregulator");

                if (SemVersion.Parse(release.TagName) > Application.ProductVersion)
                {
                    lblUpdate.Visible = false;
                    LinkLabel.Link link = new LinkLabel.Link();
                    link.LinkData = UPDATE_LINK;
                    llbUpdate.Links.Add(link);
                    llbUpdate.Visible = true;
                }
                else
                {
                    lblUpdate.Text = "App up to date";
                }
            }
            catch (Exception ex) when(ex is HttpRequestException || ex is Octokit.ApiException || ex is ArgumentException)
            {
                lblUpdate.Text = "Update status unknown";
            }
        }
        private void initializeVideoList()
        {
            bool existed = false;

            try
            {
                string   videosFolderPath = Utilities.ProgramFiles() + HELP_VIDEO_PATH;
                string[] videosPaths      = Directory.GetFiles(videosFolderPath, "*.mp4");
                if (videosPaths != null && videosPaths.Length > 0)
                {
                    videoListPanel.RowCount = videosPaths.Length;
                    for (int i = 0; i < videosPaths.Length; i++)
                    {
                        LinkLabel label = new LinkLabel();
                        label.Text         = getVideoFileName(videosPaths[i]);
                        label.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
                        LinkLabel.Link link = new LinkLabel.Link();
                        link.LinkData = videosPaths[i];
                        label.Links.Add(link);
                        label.Height    = 70;
                        label.Width     = 600;
                        label.TextAlign = ContentAlignment.MiddleLeft;
                        label.ForeColor = Color.FromArgb(95, 96, 98);
                        label.Font      = new Font("Arial", 15);
                        label.Click    += new System.EventHandler(this.linkLabel_Click);
                        videoListPanel.Controls.Add(label, 0, i);
                    }
                    existed = true;
                }
            }
            catch (DirectoryNotFoundException)
            { }
            if (!existed)
            {
                Tab_help.Tab2 = "";
            }
        }
Example #22
0
        private async void FormMain_Load(object sender, EventArgs e)
        {
            Text     = "DRB Icon Appender " + System.Windows.Forms.Application.ProductVersion;
            Location = settings.WindowLocation;
            Size     = settings.WindowSize;
            if (settings.WindowMaximized)
            {
                WindowState = FormWindowState.Maximized;
            }

            txtGameDir.Text = settings.GameDir;
            loadFiles(txtGameDir.Text, true);

            GitHubClient gitHubClient = new GitHubClient(new ProductHeaderValue("DRB-Icon-Appender"));

            try
            {
                Release release = await gitHubClient.Repository.Release.GetLatest("JKAnderson", "DRB-Icon-Appender");

                if (SemVersion.Parse(release.TagName) > System.Windows.Forms.Application.ProductVersion)
                {
                    lblUpdate.Visible = false;
                    LinkLabel.Link link = new LinkLabel.Link();
                    link.LinkData = UPDATE_URL;
                    llbUpdate.Links.Add(link);
                    llbUpdate.Visible = true;
                }
                else
                {
                    lblUpdate.Text = "App up to date";
                }
            }
            catch (Exception ex) when(ex is HttpRequestException || ex is ApiException || ex is ArgumentException)
            {
                lblUpdate.Text = "Update status unknown";
            }
        }
        public BoxAbout()
        {
            InitializeComponent();
            Text = $"About {AssemblyTitle}";

            var link   = new LinkLabel.Link();
            var link2  = new LinkLabel.Link();
            var link3  = new LinkLabel.Link();
            var link4  = new LinkLabel.Link();
            var link5  = new LinkLabel.Link();
            var link6  = new LinkLabel.Link();
            var link7  = new LinkLabel.Link();
            var link8  = new LinkLabel.Link();
            var link9  = new LinkLabel.Link();
            var link10 = new LinkLabel.Link();

            link.LinkData = "https://github.com/StephenCasella/SoundCloud-Playlist-Sync/releases";
            link_github2.Links.Add(link);
            link2.LinkData = "https://github.com/erwinkramer/SoundCloud-Playlist-Sync/releases";
            link_github.Links.Add(link2);
            link9.LinkData = "https://github.com/valentingiraud";
            link_github_contributor_1.Links.Add(link9);
            link3.LinkData = "https://github.com/mono/taglib-sharp/releases";
            link_taglib.Links.Add(link3);
            link4.LinkData = "https://github.com/JamesNK/Newtonsoft.Json/releases";
            link_JSON.Links.Add(link4);
            link5.LinkData = "https://www.postsharp.net/downloads";
            link_postsharp.Links.Add(link5);
            link6.LinkData = "https://github.com/naudio/NAudio";
            link_nAudio.Links.Add(link6);
            link7.LinkData = "https://github.com/Corey-M/NAudio.Lame";
            link_naudioLame.Links.Add(link7);
            link8.LinkData = "https://htmlagilitypack.codeplex.com";
            link_HtmlAgilityPack.Links.Add(link8);
            link10.LinkData = "https://github.com/HongSic";
            linkLabel1.Links.Add(link10); linkLabel2.Links.Add(link10); linkLabel3.Links.Add(link10);
        }
        public AboutDialog()
        {
            InitializeComponent();
            Version version = AssemblyVersion;

            this.Text = String.Format("About {0}", AssemblyTitle);
            this.labelProductName.Text = AssemblyTitle;
            this.labelVersion.Text     = String.Format("v{0}.{1} ({2} {3})", version.Major, version.Minor, "build" /* OtherStrings.Build.ToLower() */, version.Build);
            this.labelCopyright.Text   = String.Format("{0} {1}", AssemblyCopyright, Encoding.ASCII.GetString(Convert.FromBase64String("")));
            this.tableLayoutPanel.ColumnStyles[0].Width = this.labelProductName.Width + 8;
            LinkLabel.Link hl = new LinkLabel.Link();
            hl.Description          = "desc";
            hl.LinkData             = hl.Name = "http://code.google.com/p/transmission-remote-dotnet";
            hl.Start                = labelHomepageLink.Text.Length + 1;
            hl.Length               = hl.Name.Length;
            labelHomepageLink.Text += " " + hl.Name;
            this.labelHomepageLink.Links.Add(hl);
            bool first = true;

            foreach (KeyValuePair <string, string> c in coders)
            {
                LinkLabel.Link l = new LinkLabel.Link();
                l.Description = "desc";
                l.LinkData    = Encoding.ASCII.GetString(Convert.FromBase64String(c.Value));
                l.Name        = string.Format("{0} <{1}>", c.Key, l.LinkData);
                if (!first)
                {
                    labelDevelopers.Text += ",";
                }
                l.Start               = labelDevelopers.Text.Length + 1;
                l.Length              = l.Name.Length;
                labelDevelopers.Text += " " + l.Name;
                labelDevelopers.Links.Add(l);
                first = false;
            }
        }
Example #25
0
        private void AboutDialog_Load(object sender, System.EventArgs e)
        {
            // add links to link labels

            LinkLabel.Link link1 = new LinkLabel.Link();
            link1.LinkData = "http://www.aleprojects.com/en/doc/parser";
            linkLabel1.Links.Add(link1);

            LinkLabel.Link link2 = new LinkLabel.Link();
            link2.LinkData = "http://www.flaticon.com/authors/pixel-buddha";
            linkLabel2.Links.Add(link2);

            LinkLabel.Link link3 = new LinkLabel.Link();
            link3.LinkData = "https://www.youtube.com/user/mburdis";
            linkLabel3.Links.Add(link3);

            LinkLabel.Link link4 = new LinkLabel.Link();
            link4.LinkData = "http://www.idius.net/about-ppp/";
            linkLabel4.Links.Add(link4);

            LinkLabel.Link link5 = new LinkLabel.Link();
            link5.LinkData = "https://fr.pinterest.com/peneloped63/";
            linkLabel5.Links.Add(link5);
        }
Example #26
0
 private void Form1_Load(object sender, EventArgs e)
 {
     LinkLabel.Link enlace = new LinkLabel.Link();
     enlace.LinkData = "https://github.com/LeynerCordoba";
     LinkVisitanos.Links.Add(enlace);
 }
Example #27
0
 private void AddLink()
 {
     LinkLabel.Link link = new LinkLabel.Link();
     link.LinkData = "https://xoru.eu";
     linkXoru.Links.Add(link);
 }
        /// <summary>
        /// Updates the options display.
        /// </summary>
        public void UpdateOptionsDisplay()
        {
            CheckDisposed();

            m_insertPanel.SuspendLayout();
            SuspendLayout();
            m_insertPanel.Controls.Clear();
            Font f = new Font("Arial", 10);
            bool displayingOpts = false;

            foreach (InsertOption opt in m_options)
            {
                if (opt.shouldDisplay == null || opt.shouldDisplay(opt.type))
                {
                    LinkLabel linkLabel = new LinkLabel();
                    linkLabel.AutoSize         = true;
                    linkLabel.Font             = f;
                    linkLabel.TabStop          = true;
                    linkLabel.VisitedLinkColor = Color.Blue;
                    linkLabel.LinkClicked     += new LinkLabelLinkClickedEventHandler(link_LinkClicked);
                    if (opt.type == RuleInsertType.INDEX)
                    {
                        int[]         indices = opt.displayIndices();
                        StringBuilder sb      = new StringBuilder();
                        for (int i = 0; i < indices.Length; i++)
                        {
                            sb.Append(indices[i]);
                            if (i < indices.Length - 1)
                            {
                                sb.Append(" ");
                            }
                        }
                        linkLabel.Text = sb.ToString();

                        linkLabel.Links.Clear();
                        int start = 0;
                        foreach (int index in indices)
                        {
                            int            len  = Convert.ToString(index).Length;
                            LinkLabel.Link link = linkLabel.Links.Add(start, len, RuleInsertType.INDEX);
                            // use the tag property to store the index for this link
                            link.Tag = index;
                            start   += len + 1;
                        }
                    }
                    else
                    {
                        linkLabel.Text = GetOptionString(opt.type);
                        linkLabel.Links[0].LinkData = opt.type;
                    }

                    m_insertPanel.Controls.Add(linkLabel);
                    displayingOpts = true;
                }
            }

            if (!displayingOpts && m_noOptsMsg != null)
            {
                string text = m_noOptsMsg();
                if (text != null)
                {
                    m_msgLabel       = new GrowLabel();
                    m_msgLabel.Font  = f;
                    m_msgLabel.Text  = text;
                    m_msgLabel.Width = m_insertPanel.ClientSize.Width;
                    m_insertPanel.Controls.Add(m_msgLabel);
                }
            }
            else if (m_msgLabel != null)
            {
                m_msgLabel = null;
            }

            m_insertPanel.ResumeLayout(false);
            m_insertPanel.PerformLayout();
            ResumeLayout(false);

            Height = m_insertPanel.PreferredSize.Height;
        }
Example #29
0
        private void SpringsettingForm_Load(object sender, EventArgs e)
        {
            SuspendLayout(); //pause layout until all element is set
            try
            {
                Program.ToolTip.SetText(highlighttextBox, "Highlight any options that contain this term as name");
                Program.ToolTip.SetText(highlightlabel, "Highlighter");

                Program.ToolTip.SetText(engineDefaultButton, "Replace all entries with Spring's default values");
                Program.ToolTip.SetText(cancelButton, "Exit, do not commit change");
                Program.ToolTip.SetText(applyButton, "Write all entries to Springsettings.cfg");

                if (!Program.SpringPaths.GetEngineList().Any())
                {
                    Program.Downloader.GetResource(DownloadType.ENGINE, GlobalConst.DefaultEngineOverride);
                    this.Close();
                    return;
                }

                settingsOptions = new SpringSettings().GetEngineConfigOptions(Program.SpringPaths, GlobalConst.DefaultEngineOverride);

                var location = 0;
                foreach (var kvp in settingsOptions) //ref: http://www.dotnetperls.com/dictionary, http://stackoverflow.com/questions/10556205/deserializing-a-json-with-variable-name-value-pairs-into-object-in-c-sharp
                {
                    var option = kvp.Value;

                    //Create links and label.
                    var NewLinkLabel = new LinkLabel();
                    NewLinkLabel.Text = kvp.Key;

                    var cPlusPlusFile          = option.declarationFile;
                    var truncatedCPlusPlusPath = Regex.Match(cPlusPlusFile, @"rts/([a-zA-Z0-9\\~\\!\\@\\#\\$\\%\\^\\&amp;\\*\\(\\)_\\-\\=\\+\\\\\\/\\?\\.\\:\\;\\'\\,]*)?", RegexOptions.IgnoreCase);
                    //Reference: http://www.dotnetperls.com/regex-match, http://weblogs.asp.net/farazshahkhan/archive/2008/08/09/regex-to-find-url-within-text-and-make-them-as-link.aspx

                    var hyperLink = "https://github.com/spring/spring/blob/develop/" + truncatedCPlusPlusPath.Groups[0].Value + "#L" + settingsOptions[kvp.Key].declarationLine;

                    var link = new LinkLabel.Link(); //Reference: http://www.dotnetperls.com/linklabel
                    link.LinkData = hyperLink;

                    NewLinkLabel.LinkClicked += LinkedLabelClicked;
                    NewLinkLabel.Links.Add(0, 250, link.LinkData); //Reference: http://www.c-sharpcorner.com/uploadfile/mahesh/linklabel-in-C-Sharp/
                    NewLinkLabel.Location = new Point(10, location);
                    NewLinkLabel.Size     = new Size(250, 17);
                    NewLinkLabel.AccessibleDescription = truncatedCPlusPlusPath.Groups[0].Value + "#L" + settingsOptions[kvp.Key].declarationLine;
                    Program.ToolTip.SetText(NewLinkLabel, "Hyperlink: Spring/" + truncatedCPlusPlusPath.Groups[0].Value + "#L" + settingsOptions[kvp.Key].declarationLine);

                    // Set up/customize the ToolTip text for the Button and Checkbox.
                    var tooltip = "";
                    if (option.description != null)
                    {
                        tooltip += string.Format("Description: {0}\n", option.description);
                    }
                    if (option.readOnly == 1)
                    {
                        tooltip += string.Format("ReadOnly: True\n");
                    }
                    if (option.defaultValue != null)
                    {
                        tooltip += string.Format("DefaultValue: {0}\n", option.defaultValue);
                    }
                    if (option.safemodeValue != null)
                    {
                        tooltip += string.Format("SafeModeValue: {0}\n", option.safemodeValue);
                    }
                    if (option.minimumValue != null)
                    {
                        tooltip += string.Format("MinimumValue: {0}\n", option.minimumValue);
                    }
                    if (option.maximumValue != null)
                    {
                        tooltip += string.Format("MaximumValue: {0}\n", option.maximumValue);
                    }

                    if (option.type == "bool") //customized tooltip for boolean entry
                    {
                        //Create checkbox
                        var NewCheckBox  = new CheckBox();
                        var presentValue = Program.EngineConfigurator.GetConfigValue(kvp.Key);
                        if (presentValue != null) //retrieve value from Springsetting.cfg
                        {
                            NewCheckBox.Checked = presentValue == "1";
                        }
                        else
                        {
                            NewCheckBox.Checked = option.defaultValue == "1";
                        }
                        NewCheckBox.Location = new Point(260, location);
                        NewCheckBox.Size     = new Size(200, 17);
                        NewCheckBox.Name     = kvp.Key;
                        NewCheckBox.AccessibleDescription = tooltip;

                        //add all the controls
                        panel1.Controls.Add(NewLinkLabel);
                        panel1.Controls.Add(NewCheckBox);

                        Program.ToolTip.SetText(NewCheckBox, tooltip);
                    }
                    else
                    {
                        //Create textbox
                        var NewTextBox   = new TextBox();
                        var presentValue = Program.EngineConfigurator.GetConfigValue(kvp.Key);
                        if (presentValue != null)
                        {
                            NewTextBox.Text = presentValue;
                        }
                        else
                        {
                            NewTextBox.Text = option.defaultValue;
                        }
                        NewTextBox.Location = new Point(260, location);
                        NewTextBox.Size     = new Size(200, 17);
                        NewTextBox.Name     = kvp.Key;
                        NewTextBox.AccessibleDescription = tooltip;

                        //add all the controls
                        panel1.Controls.Add(NewLinkLabel);
                        panel1.Controls.Add(NewTextBox);

                        Program.ToolTip.SetText(NewTextBox, tooltip);
                    }

                    //lower next entry position -30 points
                    location = location + 30;
                }
                Icon = ZklResources.ZkIcon;
            }
            catch (Exception ex) {
                ErrorHandling.HandleException(ex, false);
            }
            ResumeLayout();
        }
        // Called when the user clicks an arrow in the crumbBar.  This displays a
        // list of methods called by the method to the left of the arrow.  If the
        // user selects one, we navigate to the the corresponding Record/Row in TheListView.
        private void ShowCalledMethodsForCrumbBarLink(LinkLabel.Link clickedLink)
        {
            Record            methodRecord    = (Record)clickedLink.LinkData;
            MethodObject      lastMethod      = null;
            int               sequentialCount = 1;
            ContextMenuStrip  menu            = new ContextMenuStrip();
            ToolStripMenuItem menuItem        = null;

            // Scan records starting after the record whose called methods we want.
            // Stop when we run out of records, reach the end of method whose called
            // records we want (based on StackDepth), or put 30 items in the context menu.
            for (int i = methodRecord.Index + 1;
                 i < _records.Count && menu.Items.Count < 30;
                 ++i) //
            {
                if (_records[i].Thread == methodRecord.Thread)
                {
                    if (_records[i].StackDepth > methodRecord.StackDepth)
                    {
                        if (_records[i].IsEntry && _records[i].Caller == methodRecord)
                        {
                            if (_records[i].MethodName == lastMethod)
                            {
                                // There may be many sequential calls to the same method.  Instead of creating
                                // a MenuItem for each, count the calls and include the count in a single
                                // MenuItem's Text.
                                ++sequentialCount;
                            }
                            else
                            {
                                if (sequentialCount > 1)
                                {
                                    menuItem.Text   = string.Format("{0} ({1} calls)", lastMethod.Name, sequentialCount);
                                    sequentialCount = 1;
                                }

                                lastMethod            = _records[i].MethodName;
                                menuItem              = new ToolStripMenuItem(lastMethod.Name, null, CrumbBarMenuItemClicked);
                                menuItem.Enabled      = _records[i].IsVisible;
                                menuItem.Tag          = _records[i];
                                menuItem.DisplayStyle = ToolStripItemDisplayStyle.Text;
                                menu.Items.Add(menuItem);
                            }
                        }
                    }
                    else
                    {
                        break;
                    }
                } // Same thread.
            }

            if (sequentialCount > 1)
            {
                menuItem.Text = string.Format("{0} ({1} calls)", lastMethod.Name, sequentialCount);
            }

            menu.ShowCheckMargin  = false;
            menu.ShowImageMargin  = false;
            menu.ShowItemToolTips = false;

            if (menu.Items.Count == 0)
            {
                //clickedLink.Enabled = false;
                menuItem         = new ToolStripMenuItem("No calls");
                menuItem.Enabled = false;
                menu.Items.Add(menuItem);
                //linkLabel1.Text = linkLabel1.Text.Remove(clickedLink.Start);
                linkLabel1.Links.Remove(clickedLink);
            }

            menu.Show(this, this.PointToClient(Control.MousePosition));
        }