SIGN IN SIGN UP
cefsharp / CefSharp UNCLAIMED

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework

0 0 1 C#
// Copyright © 2010 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.IO;
2010-12-03 16:22:41 +00:00
using System.Reflection;
using System.Windows.Forms;
2012-02-23 13:20:34 -08:00
namespace CefSharp.WinForms.Example
2010-12-03 16:22:41 +00:00
{
partial class AboutBox : Form
{
private Assembly ExecutingAssembly { get; set; }
2010-12-03 16:22:41 +00:00
public string AssemblyTitle
{
get
{
var attributes = ExecutingAssembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length == 0)
2010-12-03 16:22:41 +00:00
{
return Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
2010-12-03 16:22:41 +00:00
}
var titleAttribute = (AssemblyTitleAttribute)attributes[0];
return titleAttribute.Title != "" ? titleAttribute.Title : Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
2010-12-03 16:22:41 +00:00
}
}
public string AssemblyVersion
{
get
{
return ExecutingAssembly.GetName().Version.ToString();
2010-12-03 16:22:41 +00:00
}
}
public string AssemblyDescription
{
get
{
var attributes = ExecutingAssembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
return attributes.Length == 0 ? "" : ((AssemblyDescriptionAttribute)attributes[0]).Description;
2010-12-03 16:22:41 +00:00
}
}
public string AssemblyProduct
{
get
{
var attributes = ExecutingAssembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false);
return attributes.Length == 0 ? "" : ((AssemblyProductAttribute)attributes[0]).Product;
2010-12-03 16:22:41 +00:00
}
}
public string AssemblyCopyright
{
get
{
var attributes = ExecutingAssembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
return attributes.Length == 0 ? "" : ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
2010-12-03 16:22:41 +00:00
}
}
public string AssemblyCompany
{
get
{
var attributes = ExecutingAssembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
return attributes.Length == 0 ? "" : ((AssemblyCompanyAttribute)attributes[0]).Company;
2010-12-03 16:22:41 +00:00
}
}
public AboutBox()
{
InitializeComponent();
ExecutingAssembly = Assembly.GetExecutingAssembly();
Text = "About CefTest";
labelProductName.Text = AssemblyProduct;
labelVersion.Text = String.Format("Version {0} ", Cef.CefSharpVersion);
labelCopyright.Text = AssemblyCopyright;
labelCompanyName.Text = AssemblyCompany;
textBoxDescription.Text = "CefSharp - .Net binding for Chromium\r\n\r\n"
+ "Built on Chromium Embedded Framework\r\n"
+ " - " + Cef.CefVersion + "\r\n"
+ "Built on Chromium\r\n"
+ " - " + Cef.ChromiumVersion + "\r\n";
}
2010-12-03 16:22:41 +00:00
}
}