Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@814 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
40 changed files with 640 additions and 86 deletions
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 657 B |
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,210 @@
@@ -0,0 +1,210 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Core; |
||||
|
||||
namespace ICSharpCode.AddInManager |
||||
{ |
||||
public class AboutForm : System.Windows.Forms.Form |
||||
{ |
||||
Font boldFont; |
||||
|
||||
public AboutForm(AddIn addIn) |
||||
{ |
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent(); |
||||
|
||||
boldFont = new Font(Font, FontStyle.Bold); |
||||
|
||||
List<string> titles = new List<string>(); |
||||
List<string> values = new List<string>(); |
||||
|
||||
this.Text = addIn.Name; |
||||
closeButton.Text = ResourceService.GetString("Global.CloseButtonText"); |
||||
|
||||
titles.Add("AddIn name"); |
||||
values.Add(addIn.Name); |
||||
|
||||
if (addIn.Manifest.PrimaryVersion != null && addIn.Manifest.PrimaryVersion.ToString() != "0.0.0.0") { |
||||
titles.Add("Version"); |
||||
values.Add(addIn.Manifest.PrimaryVersion.ToString()); |
||||
} |
||||
|
||||
if (addIn.Properties["author"].Length > 0) { |
||||
titles.Add("Author"); |
||||
values.Add(addIn.Properties["author"]); |
||||
} |
||||
|
||||
if (addIn.Properties["copyright"].Length > 0) { |
||||
titles.Add("Copyright"); |
||||
values.Add(addIn.Properties["copyright"]); |
||||
} |
||||
|
||||
if (addIn.Properties["url"].Length > 0) { |
||||
titles.Add("Website"); |
||||
values.Add(addIn.Properties["url"]); |
||||
} |
||||
|
||||
if (addIn.Properties["description"].Length > 0) { |
||||
titles.Add("Description"); |
||||
values.Add(addIn.Properties["description"]); |
||||
} |
||||
|
||||
titles.Add("AddIn file"); |
||||
values.Add(System.IO.Path.GetFullPath(addIn.FileName)); |
||||
|
||||
titles.Add("Internal name"); |
||||
values.Add(addIn.Manifest.PrimaryIdentity); |
||||
|
||||
table.RowCount = titles.Count + 1; |
||||
table.RowStyles.Clear(); |
||||
for (int i = 0; i < titles.Count; i++) { |
||||
table.RowStyles.Add(new RowStyle(SizeType.AutoSize)); |
||||
AddRow(titles[i], values[i], i); |
||||
} |
||||
} |
||||
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
base.Dispose(disposing); |
||||
if (disposing) { |
||||
if (boldFont != null) |
||||
boldFont.Dispose(); |
||||
} |
||||
} |
||||
|
||||
void AddRow(string desc, string val, int rowIndex) |
||||
{ |
||||
Label descLabel = new Label(); |
||||
descLabel.AutoSize = true; |
||||
descLabel.Anchor = AnchorStyles.Top | AnchorStyles.Right; |
||||
descLabel.Font = boldFont; |
||||
descLabel.Text = StringParser.Parse(desc) + ":"; |
||||
table.Controls.Add(descLabel, 0, rowIndex); |
||||
|
||||
Label valLabel; |
||||
string link = GetLink(val); |
||||
if (link != null) { |
||||
LinkLabel linkLabel = new LinkLabel(); |
||||
linkLabel.LinkClicked += delegate { |
||||
try { |
||||
System.Diagnostics.Process.Start(link); |
||||
} catch (Exception ex) { |
||||
MessageService.ShowMessage(ex.ToString()); |
||||
} |
||||
}; |
||||
valLabel = linkLabel; |
||||
} else { |
||||
valLabel = new Label(); |
||||
} |
||||
valLabel.AutoSize = true; |
||||
valLabel.Text = val; |
||||
table.Controls.Add(valLabel, 1, rowIndex); |
||||
} |
||||
|
||||
string GetLink(string text) |
||||
{ |
||||
switch (text) { |
||||
case "GNU General Public License": |
||||
case "GPL": |
||||
return "http://www.gnu.org/licenses/gpl.html"; |
||||
case "LGPL": |
||||
case "GNU Lesser General Public License": |
||||
return "http://www.gnu.org/licenses/lgpl.html"; |
||||
default: |
||||
if (text.StartsWith("http://")) |
||||
return text; |
||||
if (text.StartsWith("www.")) |
||||
return "http://" + text; |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
System.Windows.Forms.Panel bottomPanel; |
||||
this.closeButton = new System.Windows.Forms.Button(); |
||||
this.table = new System.Windows.Forms.TableLayoutPanel(); |
||||
bottomPanel = new System.Windows.Forms.Panel(); |
||||
bottomPanel.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// bottomPanel
|
||||
//
|
||||
bottomPanel.Controls.Add(this.closeButton); |
||||
bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom; |
||||
bottomPanel.Location = new System.Drawing.Point(0, 233); |
||||
bottomPanel.Name = "bottomPanel"; |
||||
bottomPanel.Size = new System.Drawing.Size(351, 35); |
||||
bottomPanel.TabIndex = 0; |
||||
//
|
||||
// closeButton
|
||||
//
|
||||
this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); |
||||
this.closeButton.Location = new System.Drawing.Point(264, 6); |
||||
this.closeButton.Name = "closeButton"; |
||||
this.closeButton.Size = new System.Drawing.Size(75, 23); |
||||
this.closeButton.TabIndex = 0; |
||||
this.closeButton.Text = "Close"; |
||||
this.closeButton.UseCompatibleTextRendering = true; |
||||
this.closeButton.UseVisualStyleBackColor = true; |
||||
this.closeButton.Click += new System.EventHandler(this.CloseButtonClick); |
||||
//
|
||||
// table
|
||||
//
|
||||
this.table.ColumnCount = 2; |
||||
this.table.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); |
||||
this.table.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); |
||||
this.table.Dock = System.Windows.Forms.DockStyle.Fill; |
||||
this.table.Location = new System.Drawing.Point(0, 8); |
||||
this.table.Name = "table"; |
||||
this.table.RowCount = 2; |
||||
this.table.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); |
||||
this.table.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); |
||||
this.table.Size = new System.Drawing.Size(351, 225); |
||||
this.table.TabIndex = 1; |
||||
//
|
||||
// AboutForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.BackColor = System.Drawing.SystemColors.Info; |
||||
this.ClientSize = new System.Drawing.Size(351, 268); |
||||
this.Controls.Add(this.table); |
||||
this.Controls.Add(bottomPanel); |
||||
this.MaximizeBox = false; |
||||
this.MinimizeBox = false; |
||||
this.Name = "AboutForm"; |
||||
this.Padding = new System.Windows.Forms.Padding(0, 8, 0, 0); |
||||
this.ShowInTaskbar = false; |
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; |
||||
this.Text = "AboutForm"; |
||||
bottomPanel.ResumeLayout(false); |
||||
this.ResumeLayout(false); |
||||
} |
||||
private System.Windows.Forms.Button closeButton; |
||||
private System.Windows.Forms.TableLayoutPanel table; |
||||
#endregion
|
||||
|
||||
void CloseButtonClick(object sender, EventArgs e) |
||||
{ |
||||
Close(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,123 @@
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<root> |
||||
<!-- |
||||
Microsoft ResX Schema |
||||
|
||||
Version 2.0 |
||||
|
||||
The primary goals of this format is to allow a simple XML format |
||||
that is mostly human readable. The generation and parsing of the |
||||
various data types are done through the TypeConverter classes |
||||
associated with the data types. |
||||
|
||||
Example: |
||||
|
||||
... ado.net/XML headers & schema ... |
||||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
||||
<resheader name="version">2.0</resheader> |
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
||||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
||||
</data> |
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
||||
<comment>This is a comment</comment> |
||||
</data> |
||||
|
||||
There are any number of "resheader" rows that contain simple |
||||
name/value pairs. |
||||
|
||||
Each data row contains a name, and value. The row also contains a |
||||
type or mimetype. Type corresponds to a .NET class that support |
||||
text/value conversion through the TypeConverter architecture. |
||||
Classes that don't support this are serialized and stored with the |
||||
mimetype set. |
||||
|
||||
The mimetype is used for serialized objects, and tells the |
||||
ResXResourceReader how to depersist the object. This is currently not |
||||
extensible. For a given mimetype the value must be set accordingly: |
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format |
||||
that the ResXResourceWriter will generate, however the reader can |
||||
read any of the formats listed below. |
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
||||
value : The object must be serialized into a byte array |
||||
: using a System.ComponentModel.TypeConverter |
||||
: and then encoded with base64 encoding. |
||||
--> |
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
||||
<xsd:element name="root" msdata:IsDataSet="true"> |
||||
<xsd:complexType> |
||||
<xsd:choice maxOccurs="unbounded"> |
||||
<xsd:element name="metadata"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
||||
<xsd:attribute name="type" type="xsd:string" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="assembly"> |
||||
<xsd:complexType> |
||||
<xsd:attribute name="alias" type="xsd:string" /> |
||||
<xsd:attribute name="name" type="xsd:string" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="data"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="resheader"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:choice> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:schema> |
||||
<resheader name="resmimetype"> |
||||
<value>text/microsoft-resx</value> |
||||
</resheader> |
||||
<resheader name="version"> |
||||
<value>2.0</value> |
||||
</resheader> |
||||
<resheader name="reader"> |
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<metadata name="bottomPanel.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
||||
<value>False</value> |
||||
</metadata> |
||||
</root> |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
|
||||
namespace ICSharpCode.AddInManager |
||||
{ |
||||
public class AddInInstallBinding : IDisplayBinding |
||||
{ |
||||
public bool CanCreateContentForFile(string fileName) |
||||
{ |
||||
return true; |
||||
} |
||||
|
||||
public ICSharpCode.SharpDevelop.Gui.IViewContent CreateContentForFile(string fileName) |
||||
{ |
||||
ManagerForm.ShowForm(); |
||||
ManagerForm.Instance.ShowInstallableAddIns(new string[] { fileName }); |
||||
return null; |
||||
} |
||||
|
||||
public bool CanCreateContentForLanguage(string languageName) |
||||
{ |
||||
return false; |
||||
} |
||||
|
||||
public ICSharpCode.SharpDevelop.Gui.IViewContent CreateContentForLanguage(string languageName, string content) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue