コード例 #1
0
 private void AdjustLinkLabels()
 {
     foreach (var linkLabel in ExternalInfoTextbox.Controls.OfType <LinkLabel>())
     {
         int charPos = (int)linkLabel.Tag;
         linkLabel.Location = ExternalInfoTextbox.GetPositionFromCharIndex(charPos);
     }
 }
コード例 #2
0
        private void FillExternalLibraries()
        {
            var libraries = new List <LibInfo>();

            libraries.Add(GetLibInfo(typeof(Newtonsoft.Json.JsonConverter).Assembly,
                                     "MIT", "https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md"));

            libraries.Add(GetLibInfo(typeof(netDxf.DxfDocument).Assembly,
                                     "GNU LGPL", "https://github.com/haplokuon/netDxf/blob/master/LICENSE"));

            libraries.Add(GetLibInfo(typeof(Svg.SvgDocument).Assembly,
                                     "MS-PL", "https://github.com/vvvv/SVG/blob/master/license.txt"));

            libraries.Add(GetLibInfo(typeof(WeifenLuo.WinFormsUI.Docking.DockPanel).Assembly,
                                     "MIT", "https://github.com/dockpanelsuite/dockpanelsuite/blob/master/license.txt"));

            foreach (var libInfo in libraries)
            {
                ExternalInfoTextbox.AppendText($"{libInfo.Title} version {libInfo.Version}\r\n");

                //if (!string.IsNullOrEmpty(libInfo.Description))
                //    ExternalInfoTextbox.AppendText($"{libInfo.Description}\r\n");
                //else if (!string.IsNullOrEmpty(libInfo.Title) && libInfo.Title.Length > 3)
                //    ExternalInfoTextbox.AppendText($"{libInfo.Title}\r\n");

                if (!string.IsNullOrEmpty(libInfo.Copyright))
                {
                    ExternalInfoTextbox.AppendText($"{libInfo.Copyright}\r\n");
                }

                if (!string.IsNullOrEmpty(libInfo.License))
                {
                    //ExternalInfoTextbox.AppendText($"Licensed under {libInfo.License}\r\n");
                    ExternalInfoTextbox.AppendText($"Licensed under ");

                    var licenseLink = new LinkLabel()
                    {
                        Text     = libInfo.License,
                        AutoSize = true
                    };
                    licenseLink.Links.Add(new LinkLabel.Link()
                    {
                        LinkData = libInfo.Websiste
                    });

                    licenseLink.Location     = ExternalInfoTextbox.GetPositionFromCharIndex(ExternalInfoTextbox.TextLength);
                    licenseLink.Tag          = ExternalInfoTextbox.TextLength;
                    licenseLink.LinkClicked += LicenseLink_LinkClicked;

                    ExternalInfoTextbox.Controls.Add(licenseLink);
                    ExternalInfoTextbox.AppendText("\r\n");
                }

                ExternalInfoTextbox.AppendText("\r\n");
            }
        }
コード例 #3
0
        private void AdjustLinkLabels()
        {
            //var scrollOffset = ExternalInfoTextbox.GetPositionFromCharIndex(0);

            foreach (var linkLabel in ExternalInfoTextbox.Controls.OfType <LinkLabel>())
            {
                int charPos = (int)linkLabel.Tag;
                linkLabel.Location = ExternalInfoTextbox.GetPositionFromCharIndex(charPos);
                //var origPos = (Point)linkLabel.Tag;
                //origPos.X += scrollOffset.X;
                //origPos.Y += scrollOffset.Y;
                //linkLabel.Location = origPos;
            }
        }
コード例 #4
0
        private void FillExternalLibraries()
        {
            var libraries = new List <LibInfo>();

            libraries.Add(GetLibInfo(typeof(Newtonsoft.Json.JsonConverter).Assembly,
                                     "MIT", "https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md"));

            libraries.Add(GetLibInfo(typeof(WeifenLuo.WinFormsUI.Docking.DockPanel).Assembly,
                                     "MIT", "https://github.com/dockpanelsuite/dockpanelsuite/blob/master/license.txt"));

            libraries.Add(GetLibInfo(typeof(ICSharpCode.SharpZipLib.Zip.ZipFile).Assembly,
                                     "MIT", "https://github.com/icsharpcode/SharpZipLib/blob/master/LICENSE.txt"));

            libraries.Add(GetLibInfo(typeof(OpenTK.Vector3).Assembly,
                                     "MIT", "https://github.com/opentk/opentk/blob/master/License.txt"));

            libraries.Add(GetLibInfo(typeof(BrightIdeasSoftware.ObjectListView).Assembly,
                                     "GNU GPL", "https://sourceforge.net/p/objectlistview/code/HEAD/tree/cs/trunk/COPYING"));

            libraries.Add(GetLibInfo(typeof(Assimp.Vector3D).Assembly,
                                     "MIT", "https://bitbucket.org/Starnick/assimpnet/src/master/License.txt"));

            libraries.Add(GetLibInfo(typeof(QuickFont.QFont).Assembly,
                                     "MIT", "https://github.com/opcon/QuickFont/blob/master/License.txt"));

            libraries.Add(GetLibInfo(typeof(ObjectTK.GLObject).Assembly,
                                     "MIT", "https://github.com/Polymaker/ObjectTK/blob/master/LICENSE"));

            foreach (var libInfo in libraries)
            {
                ExternalInfoTextbox.AppendText($"{libInfo.Title} version {libInfo.Version}\r\n");

                if (!string.IsNullOrEmpty(libInfo.Copyright))
                {
                    ExternalInfoTextbox.AppendText($"{libInfo.Copyright}\r\n");
                }

                if (!string.IsNullOrEmpty(libInfo.License))
                {
                    ExternalInfoTextbox.AppendText($"Licensed under ");

                    var licenseLink = new LinkLabel()
                    {
                        Text     = libInfo.License,
                        AutoSize = true
                    };
                    licenseLink.Links.Add(new LinkLabel.Link()
                    {
                        LinkData = libInfo.Websiste
                    });

                    licenseLink.Location     = ExternalInfoTextbox.GetPositionFromCharIndex(ExternalInfoTextbox.TextLength);
                    licenseLink.Tag          = ExternalInfoTextbox.TextLength;
                    licenseLink.LinkClicked += LicenseLink_LinkClicked;

                    ExternalInfoTextbox.Controls.Add(licenseLink);
                    ExternalInfoTextbox.AppendText("\r\n");
                }

                ExternalInfoTextbox.AppendText("\r\n");
            }
        }