16 changed files with 20 additions and 2155 deletions
@ -1,78 +0,0 @@
@@ -1,78 +0,0 @@
|
||||
<AddIn name = "AddInManager" |
||||
author = "Daniel Grunwald" |
||||
copyright = "prj:///doc/copyright.txt" |
||||
description = "Can install, enable, disable and uninstall AddIns" |
||||
addInManagerHidden = "preinstalled"> |
||||
|
||||
<Manifest> |
||||
<Identity name = "ICSharpCode.AddInManager"/> |
||||
</Manifest> |
||||
|
||||
<Runtime> |
||||
<Import assembly = "ICSharpCode.AddInManager.dll"> |
||||
<ConditionEvaluator name="AddInManagerAddInState" class="ICSharpCode.AddInManager.AddInManagerAddInStateConditionEvaluator"/> |
||||
<ConditionEvaluator name="AddInManager2NotInstalled" class="ICSharpCode.AddInManager.AddInManager2NotInstalledConditionEvaluator"/> |
||||
</Import> |
||||
</Runtime> |
||||
|
||||
<Path name = "/SharpDevelop/Workbench/Tools"> |
||||
<Condition name="AddInManager2NotInstalled"> |
||||
<MenuItem id = "ShowAddInManager" |
||||
label = "${res:AddInManager.Title}" |
||||
class = "ICSharpCode.AddInManager.ShowCommand"/> |
||||
</Condition> |
||||
</Path> |
||||
|
||||
<Path name = "/SharpDevelop/Workbench/DisplayBindings"> |
||||
<DisplayBinding id = "AddInManager" |
||||
class = "ICSharpCode.AddInManager.AddInInstallBinding" |
||||
insertbefore = "Text" |
||||
fileNamePattern = "\.sdaddin$" |
||||
title = "Install with AddIn manager"/> |
||||
</Path> |
||||
|
||||
<Path name = "/AddIns/AddInManager/ContextMenu"> |
||||
<Condition name="AddInManagerAddInState" states="Enable"> |
||||
<MenuItem id="Disable" |
||||
label="${res:AddInManager.ActionDisable}" |
||||
class="ICSharpCode.AddInManager.DisableCommand"/> |
||||
</Condition> |
||||
<Condition name="AddInManagerAddInState" states="Disable"> |
||||
<MenuItem id="Enable" |
||||
label="${res:AddInManager.ActionEnable}" |
||||
class="ICSharpCode.AddInManager.EnableCommand"/> |
||||
</Condition> |
||||
<Condition name="AddInManagerAddInState" states="Enable,Disable,InstalledTwice,DependencyError,CustomError"> |
||||
<MenuItem id="Uninstall" |
||||
label="${res:AddInManager.ActionUninstall}" |
||||
class="ICSharpCode.AddInManager.UninstallCommand"/> |
||||
</Condition> |
||||
<Condition name="AddInManagerAddInState" states="Install"> |
||||
<MenuItem id="AbortInstall" |
||||
label="${res:AddInManager.ActionCancelInstallation}" |
||||
class="ICSharpCode.AddInManager.AbortInstallCommand"/> |
||||
</Condition> |
||||
<Condition name="AddInManagerAddInState" states="Uninstall"> |
||||
<MenuItem id="AbortUninstall" |
||||
label="${res:AddInManager.ActionCancelDeinstallation}" |
||||
class="ICSharpCode.AddInManager.EnableCommand"/> |
||||
</Condition> |
||||
<Condition name="AddInManagerAddInState" states="Update"> |
||||
<MenuItem id="AbortUpdate" |
||||
label="${res:AddInManager.ActionCancelUpdate}" |
||||
class="ICSharpCode.AddInManager.AbortUpdateCommand"/> |
||||
</Condition> |
||||
<MenuItem id="Separator1" type="Separator"/> |
||||
<MenuItem id="GoToHomepage" |
||||
label="${res:AddInManager.OpenWebsite}" |
||||
class="ICSharpCode.AddInManager.OpenHomepageCommand" |
||||
loadclasslazy="false"/> |
||||
<MenuItem id="Options" |
||||
label="${res:AddInManager.Options}" |
||||
class="ICSharpCode.AddInManager.OptionsCommand" |
||||
loadclasslazy="false"/> |
||||
<MenuItem id="About" |
||||
label="${res:AddInManager.About}" |
||||
class="ICSharpCode.AddInManager.AboutCommand"/> |
||||
</Path> |
||||
</AddIn> |
@ -1,95 +0,0 @@
@@ -1,95 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>ICSharpCode.AddInManager</RootNamespace> |
||||
<AssemblyName>ICSharpCode.AddInManager</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{F93E52FD-DA66-4CE5-A0CB-BCD902811122}</ProjectGuid> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>111149056</BaseAddress> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
||||
<TargetFrameworkProfile> |
||||
</TargetFrameworkProfile> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<OutputPath>..\..\..\..\..\AddIns\Misc\AddInManager\</OutputPath> |
||||
<Optimize>False</Optimize> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<OutputPath>..\..\..\..\..\AddIns\Misc\AddInManager\</OutputPath> |
||||
<Optimize>True</Optimize> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<DebugSymbols>false</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
<Reference Include="System.Xml" /> |
||||
<Reference Include="ICSharpCode.SharpZipLib"> |
||||
<HintPath>..\RequiredLibraries\ICSharpCode.SharpZipLib.dll</HintPath> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
</Reference> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="AddInManager.addin"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||
<Compile Include="Src\Commands.cs" /> |
||||
<Compile Include="Src\ManagerForm.cs"> |
||||
<SubType>Form</SubType> |
||||
</Compile> |
||||
<EmbeddedResource Include="Src\ManagerForm.resx"> |
||||
<DependentUpon>ManagerForm.cs</DependentUpon> |
||||
</EmbeddedResource> |
||||
<Compile Include="Src\AddInControl.cs"> |
||||
<SubType>Component</SubType> |
||||
</Compile> |
||||
<Compile Include="Src\InstallableAddIn.cs" /> |
||||
<Compile Include="Src\AboutForm.cs"> |
||||
<SubType>Form</SubType> |
||||
</Compile> |
||||
<EmbeddedResource Include="Src\AboutForm.resx"> |
||||
<DependentUpon>AboutForm.cs</DependentUpon> |
||||
</EmbeddedResource> |
||||
<Compile Include="Src\AddInInstallBinding.cs" /> |
||||
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs"> |
||||
<Link>Configuration\GlobalAssemblyInfo.cs</Link> |
||||
</Compile> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
||||
<Name>ICSharpCode.Core</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
||||
<Name>ICSharpCode.SharpDevelop</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\ICSharpCode.Core.WinForms\ICSharpCode.Core.WinForms.csproj"> |
||||
<Project>{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}</Project> |
||||
<Name>ICSharpCode.Core.WinForms</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -1,16 +0,0 @@
@@ -1,16 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System.Reflection; |
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: AssemblyTitle("AddInManager")] |
||||
[assembly: AssemblyDescription("AddInManager for ICSharpCode.Core")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
@ -1,216 +0,0 @@
@@ -1,216 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
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) { |
||||
if (!addIn.Properties["copyright"].StartsWith("prj:")) { |
||||
titles.Add("Copyright"); |
||||
values.Add(addIn.Properties["copyright"]); |
||||
} |
||||
} |
||||
|
||||
if (addIn.Properties["license"].Length > 0) { |
||||
titles.Add("License"); |
||||
values.Add(addIn.Properties["license"]); |
||||
} |
||||
|
||||
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(FileUtility.NormalizePath(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) |
||||
{ |
||||
if (text == null) |
||||
return null; |
||||
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(); |
||||
} |
||||
} |
||||
} |
@ -1,123 +0,0 @@
@@ -1,123 +0,0 @@
|
||||
<?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> |
@ -1,191 +0,0 @@
@@ -1,191 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Drawing.Drawing2D; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Core.WinForms; |
||||
|
||||
namespace ICSharpCode.AddInManager |
||||
{ |
||||
public class AddInControl : Control |
||||
{ |
||||
AddIn addIn; |
||||
bool isExternal; |
||||
|
||||
public AddIn AddIn { |
||||
get { |
||||
return addIn; |
||||
} |
||||
} |
||||
|
||||
public AddInControl(AddIn addIn) |
||||
{ |
||||
this.addIn = addIn; |
||||
this.BackColor = SystemColors.Window; |
||||
this.ContextMenuStrip = MenuService.CreateContextMenu(this, "/AddIns/AddInManager/ContextMenu"); |
||||
|
||||
isExternal = !FileUtility.IsBaseDirectory(FileUtility.ApplicationRootPath, addIn.FileName) |
||||
&& !FileUtility.IsBaseDirectory(PropertyService.ConfigDirectory, addIn.FileName); |
||||
|
||||
this.ClientSize = new Size(100, isExternal ? 35 + pathHeight : 35); |
||||
this.SetStyle(ControlStyles.Selectable, true); |
||||
this.SetStyle(ControlStyles.UserPaint, true); |
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); |
||||
this.SetStyle(ControlStyles.ResizeRedraw, true); |
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); |
||||
} |
||||
|
||||
bool selected; |
||||
|
||||
public bool Selected { |
||||
get { |
||||
return selected; |
||||
} |
||||
set { |
||||
if (selected != value) { |
||||
selected = value; |
||||
Invalidate(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
protected override void OnClick(EventArgs e) |
||||
{ |
||||
base.OnClick(e); |
||||
Focus(); |
||||
} |
||||
|
||||
Color Mix(Color c1, Color c2, double perc) |
||||
{ |
||||
double p1 = 1 - perc; |
||||
double p2 = perc; |
||||
return Color.FromArgb((int)(c1.R * p1 + c2.R * p2), |
||||
(int)(c1.G * p1 + c2.G * p2), |
||||
(int)(c1.B * p1 + c2.B * p2)); |
||||
} |
||||
|
||||
protected override void OnPaint(PaintEventArgs e) |
||||
{ |
||||
Graphics g = e.Graphics; |
||||
Rectangle bounds = this.ClientRectangle; |
||||
bounds.Offset(1, 1); |
||||
bounds.Inflate(-2, -2); |
||||
Color startColor = SystemColors.ControlLightLight; |
||||
Color endColor = SystemColors.Control; |
||||
if (selected) { |
||||
startColor = Mix(SystemColors.ControlLightLight, SystemColors.Highlight, 0.1); |
||||
endColor = Mix(SystemColors.ControlLightLight, SystemColors.Highlight, 0.65); |
||||
} |
||||
Brush gradient = new LinearGradientBrush(bounds, |
||||
startColor, |
||||
endColor, |
||||
LinearGradientMode.ForwardDiagonal); |
||||
|
||||
GraphicsPath path = new GraphicsPath(); |
||||
|
||||
const int egdeRadius = 3; |
||||
const int innerMargin = egdeRadius + 2; |
||||
|
||||
RectangleF arcRect = new RectangleF(bounds.Location, new SizeF(egdeRadius * 2, egdeRadius * 2)); |
||||
//top left Arc
|
||||
path.AddArc(arcRect, 180, 90); |
||||
path.AddLine(bounds.X + egdeRadius, bounds.Y, bounds.Right - egdeRadius, bounds.Y); |
||||
// top right arc
|
||||
arcRect.X = bounds.Right - egdeRadius * 2; |
||||
path.AddArc(arcRect, 270, 90); |
||||
path.AddLine(bounds.Right, bounds.Left + egdeRadius, bounds.Right, bounds.Bottom - egdeRadius); |
||||
// bottom right arc
|
||||
arcRect.Y = bounds.Bottom - egdeRadius * 2; |
||||
path.AddArc(arcRect, 0, 90); |
||||
path.AddLine(bounds.X + egdeRadius, bounds.Bottom, bounds.Right - egdeRadius, bounds.Bottom); |
||||
// bottom left arc
|
||||
arcRect.X = bounds.Left; |
||||
path.AddArc(arcRect, 90, 90); |
||||
path.AddLine(bounds.X, bounds.Left + egdeRadius, bounds.X, bounds.Bottom - egdeRadius); |
||||
|
||||
g.FillPath(gradient, path); |
||||
g.DrawPath(SystemPens.ControlText, path); |
||||
path.Dispose(); |
||||
gradient.Dispose(); |
||||
Brush textBrush; |
||||
string description = GetText(out textBrush); |
||||
int titleWidth; |
||||
using (Font boldFont = new Font("Arial", 8, FontStyle.Bold)) { |
||||
g.DrawString(addIn.Name, boldFont, textBrush, innerMargin, innerMargin); |
||||
titleWidth = (int)g.MeasureString(addIn.Name, boldFont).Width + 1; |
||||
} |
||||
if (addIn.Version != null && addIn.Version.ToString() != "0.0.0.0") { |
||||
g.DrawString(addIn.Version.ToString(), Font, textBrush, innerMargin + titleWidth + 4, innerMargin); |
||||
} |
||||
RectangleF textBounds = bounds; |
||||
textBounds.Offset(innerMargin, innerMargin); |
||||
textBounds.Inflate(-innerMargin * 2, -innerMargin * 2 + 2); |
||||
if (isExternal) |
||||
textBounds.Height -= pathHeight; |
||||
using (StringFormat sf = new StringFormat(StringFormatFlags.LineLimit)) { |
||||
sf.Trimming = StringTrimming.EllipsisWord; |
||||
g.DrawString(description, Font, textBrush, textBounds, sf); |
||||
} |
||||
if (isExternal) { |
||||
textBounds.Y = textBounds.Bottom + 2; |
||||
textBounds.Height = pathHeight + 2; |
||||
using (Font font = new Font(Font.Name, 7, FontStyle.Italic)) { |
||||
using (StringFormat sf = new StringFormat(StringFormatFlags.NoWrap)) { |
||||
sf.Trimming = StringTrimming.EllipsisPath; |
||||
sf.Alignment = StringAlignment.Far; |
||||
g.DrawString(addIn.FileName, font, |
||||
selected ? SystemBrushes.HighlightText : SystemBrushes.ControlText, |
||||
textBounds, sf); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
const int pathHeight = 10; |
||||
|
||||
string GetText(out Brush textBrush) |
||||
{ |
||||
switch (addIn.Action) { |
||||
case AddInAction.Enable: |
||||
if (addIn.Enabled) { |
||||
textBrush = SystemBrushes.ControlText; |
||||
return addIn.Properties["description"]; |
||||
} else { |
||||
textBrush = SystemBrushes.ActiveCaption; |
||||
return ResourceService.GetString("AddInManager.AddInEnabled"); |
||||
} |
||||
case AddInAction.Disable: |
||||
textBrush = SystemBrushes.GrayText; |
||||
if (addIn.Enabled) |
||||
return ResourceService.GetString("AddInManager.AddInWillBeDisabled"); |
||||
else |
||||
return ResourceService.GetString("AddInManager.AddInDisabled"); |
||||
case AddInAction.Install: |
||||
textBrush = SystemBrushes.ActiveCaption; |
||||
return ResourceService.GetString("AddInManager.AddInInstalled"); |
||||
case AddInAction.Uninstall: |
||||
textBrush = SystemBrushes.GrayText; |
||||
return ResourceService.GetString("AddInManager.AddInRemoved"); |
||||
case AddInAction.Update: |
||||
textBrush = SystemBrushes.ActiveCaption; |
||||
return ResourceService.GetString("AddInManager.AddInUpdated"); |
||||
case AddInAction.InstalledTwice: |
||||
textBrush = Brushes.Red; |
||||
return ResourceService.GetString("AddInManager.AddInInstalledTwice"); |
||||
case AddInAction.DependencyError: |
||||
textBrush = Brushes.Red; |
||||
return ResourceService.GetString("AddInManager.AddInDependencyFailed"); |
||||
case AddInAction.CustomError: |
||||
textBrush = Brushes.Red; |
||||
return StringParser.Parse(addIn.CustomErrorMessage); |
||||
default: |
||||
textBrush = Brushes.Yellow; |
||||
return addIn.Action.ToString(); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,37 +0,0 @@
@@ -1,37 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Workbench; |
||||
|
||||
namespace ICSharpCode.AddInManager |
||||
{ |
||||
#if !STANDALONE
|
||||
public class AddInInstallBinding : IDisplayBinding |
||||
{ |
||||
public bool CanCreateContentForFile(FileName fileName) |
||||
{ |
||||
return true; |
||||
} |
||||
|
||||
public IViewContent CreateContentForFile(OpenedFile file) |
||||
{ |
||||
ManagerForm.ShowForm(); |
||||
ManagerForm.Instance.ShowInstallableAddIns(new string[] { file.FileName }); |
||||
return null; |
||||
} |
||||
|
||||
public bool IsPreferredBindingForFile(FileName fileName) |
||||
{ |
||||
return true; |
||||
} |
||||
|
||||
public double AutoDetectFileContent(FileName fileName, System.IO.Stream fileContent, string detectedMimeType) |
||||
{ |
||||
return 1; |
||||
} |
||||
} |
||||
#endif
|
||||
} |
@ -1,169 +0,0 @@
@@ -1,169 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.Core; |
||||
using System.Linq; |
||||
|
||||
#if !STANDALONE
|
||||
using ICSharpCode.SharpDevelop; |
||||
#endif
|
||||
|
||||
namespace ICSharpCode.AddInManager |
||||
{ |
||||
public class ShowCommand : AbstractMenuCommand |
||||
{ |
||||
#if STANDALONE
|
||||
static bool resourcesRegistered; |
||||
#endif
|
||||
|
||||
public override void Run() |
||||
{ |
||||
#if STANDALONE
|
||||
if (!resourcesRegistered) { |
||||
resourcesRegistered = true; |
||||
ResourceService.RegisterStrings("ICSharpCode.AddInManager.StringResources", typeof(ShowCommand).Assembly); |
||||
} |
||||
#endif
|
||||
ManagerForm.ShowForm(); |
||||
} |
||||
} |
||||
|
||||
public class AddInManagerAddInStateConditionEvaluator : IConditionEvaluator |
||||
{ |
||||
public bool IsValid(object caller, Condition condition) |
||||
{ |
||||
string states = condition.Properties["states"]; |
||||
string action = ((AddInControl)caller).AddIn.Action.ToString(); |
||||
foreach (string state in states.Split(',')) { |
||||
if (state == action) |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public class AddInManager2NotInstalledConditionEvaluator : IConditionEvaluator |
||||
{ |
||||
public bool IsValid(object caller, Condition condition) |
||||
{ |
||||
#if !STANDALONE
|
||||
AddIn addInManager2AddIn = SD.AddInTree.AddIns.Where( |
||||
a => ((a.Manifest != null) && (a.Manifest.PrimaryIdentity == "ICSharpCode.AddInManager2"))) |
||||
.FirstOrDefault(); |
||||
if (addInManager2AddIn != null) |
||||
{ |
||||
return !addInManager2AddIn.Enabled; |
||||
} |
||||
#endif
|
||||
|
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public class DisableCommand : AbstractMenuCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
ManagerForm.Instance.TryRunAction(((AddInControl)Owner).AddIn, AddInAction.Disable); |
||||
} |
||||
} |
||||
|
||||
public class EnableCommand : AbstractMenuCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
ManagerForm.Instance.TryRunAction(((AddInControl)Owner).AddIn, AddInAction.Enable); |
||||
} |
||||
} |
||||
|
||||
public class AbortInstallCommand : AbstractMenuCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
ManagerForm.Instance.TryRunAction(((AddInControl)Owner).AddIn, AddInAction.Uninstall); |
||||
} |
||||
} |
||||
|
||||
public class AbortUpdateCommand : AbstractMenuCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
ManagerForm.Instance.TryRunAction(((AddInControl)Owner).AddIn, AddInAction.InstalledTwice); |
||||
} |
||||
} |
||||
|
||||
public class UninstallCommand : AbstractMenuCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
ManagerForm.Instance.TryUninstall(((AddInControl)Owner).AddIn); |
||||
} |
||||
} |
||||
|
||||
public class OpenHomepageCommand : AbstractMenuCommand |
||||
{ |
||||
public override bool IsEnabled { |
||||
get { |
||||
return ((AddInControl)Owner).AddIn.Properties["url"].Length > 0; |
||||
} |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
#if STANDALONE
|
||||
try { |
||||
System.Diagnostics.Process.Start(((AddInControl)Owner).AddIn.Properties["url"]); |
||||
} catch {} |
||||
#else
|
||||
FileService.OpenFile(((AddInControl)Owner).AddIn.Properties["url"]); |
||||
#endif
|
||||
ManagerForm.Instance.Close(); |
||||
} |
||||
} |
||||
|
||||
public class AboutCommand : AbstractMenuCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
using (AboutForm form = new AboutForm(((AddInControl)Owner).AddIn)) { |
||||
form.ShowDialog(ManagerForm.Instance); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class OptionsCommand : AbstractMenuCommand |
||||
{ |
||||
public override bool IsEnabled { |
||||
get { |
||||
#if !STANDALONE
|
||||
AddIn addIn = ((AddInControl)Owner).AddIn; |
||||
if (addIn.Enabled) { |
||||
foreach (KeyValuePair<string, ExtensionPath> pair in addIn.Paths) { |
||||
if (pair.Key.StartsWith("/SharpDevelop/Dialogs/OptionsDialog")) { |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
#endif
|
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
#if !STANDALONE
|
||||
AddIn addIn = ((AddInControl)Owner).AddIn; |
||||
AddInTreeNode dummyNode = new AddInTreeNode(); |
||||
foreach (KeyValuePair<string, ExtensionPath> pair in addIn.Paths) { |
||||
if (pair.Key.StartsWith("/SharpDevelop/Dialogs/OptionsDialog")) { |
||||
dummyNode.AddCodons(pair.Value.Codons); |
||||
} |
||||
} |
||||
ICSharpCode.SharpDevelop.Commands.OptionsCommand.ShowTabbedOptions(addIn.Name + " " + ResourceService.GetString("AddInManager.Options"), |
||||
dummyNode); |
||||
#endif
|
||||
} |
||||
} |
||||
} |
@ -1,120 +0,0 @@
@@ -1,120 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpZipLib.Zip; |
||||
|
||||
namespace ICSharpCode.AddInManager |
||||
{ |
||||
public class InstallableAddIn |
||||
{ |
||||
string fileName; |
||||
bool isPackage; |
||||
AddIn addIn; |
||||
|
||||
public AddIn AddIn { |
||||
get { |
||||
return addIn; |
||||
} |
||||
} |
||||
|
||||
public InstallableAddIn(string fileName, bool isPackage) |
||||
{ |
||||
this.fileName = fileName; |
||||
this.isPackage = isPackage; |
||||
if (isPackage) { |
||||
ZipFile file = new ZipFile(fileName); |
||||
try { |
||||
LoadAddInFromZip(file); |
||||
} finally { |
||||
file.Close(); |
||||
} |
||||
} else { |
||||
addIn = AddIn.Load(SD.AddInTree, fileName); |
||||
} |
||||
if (addIn.Manifest.PrimaryIdentity == null) |
||||
throw new AddInLoadException(ResourceService.GetString("AddInManager.AddInMustHaveIdentity")); |
||||
} |
||||
|
||||
void LoadAddInFromZip(ZipFile file) |
||||
{ |
||||
ZipEntry addInEntry = null; |
||||
foreach (ZipEntry entry in file) { |
||||
if (entry.Name.EndsWith(".addin")) { |
||||
if (addInEntry != null) |
||||
throw new AddInLoadException("The package may only contain one .addin file."); |
||||
addInEntry = entry; |
||||
} |
||||
} |
||||
if (addInEntry == null) |
||||
throw new AddInLoadException("The package must contain one .addin file."); |
||||
using (Stream s = file.GetInputStream(addInEntry)) { |
||||
using (StreamReader r = new StreamReader(s)) { |
||||
addIn = AddIn.Load(SD.AddInTree, r); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public void Install(bool isUpdate) |
||||
{ |
||||
foreach (string identity in addIn.Manifest.Identities.Keys) { |
||||
ICSharpCode.Core.AddInManager.AbortRemoveUserAddInOnNextStart(identity); |
||||
} |
||||
if (isPackage) { |
||||
string targetDir = Path.Combine(ICSharpCode.Core.AddInManager.AddInInstallTemp, |
||||
addIn.Manifest.PrimaryIdentity); |
||||
if (Directory.Exists(targetDir)) |
||||
Directory.Delete(targetDir, true); |
||||
Directory.CreateDirectory(targetDir); |
||||
FastZip fastZip = new FastZip(); |
||||
fastZip.CreateEmptyDirectories = true; |
||||
fastZip.ExtractZip(fileName, targetDir, null); |
||||
|
||||
addIn.Action = AddInAction.Install; |
||||
if (!isUpdate) { |
||||
((AddInTreeImpl)SD.AddInTree).InsertAddIn(addIn); |
||||
} |
||||
} else { |
||||
ICSharpCode.Core.AddInManager.AddExternalAddIns(new AddIn[] { addIn }); |
||||
} |
||||
} |
||||
|
||||
public static void CancelUpdate(IList<AddIn> addIns) |
||||
{ |
||||
foreach (AddIn addIn in addIns) { |
||||
foreach (string identity in addIn.Manifest.Identities.Keys) { |
||||
// delete from installation temp (if installation or update is pending)
|
||||
string targetDir = Path.Combine(ICSharpCode.Core.AddInManager.AddInInstallTemp, |
||||
identity); |
||||
if (Directory.Exists(targetDir)) |
||||
Directory.Delete(targetDir, true); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public static void Uninstall(IList<AddIn> addIns) |
||||
{ |
||||
CancelUpdate(addIns); |
||||
foreach (AddIn addIn in addIns) { |
||||
foreach (string identity in addIn.Manifest.Identities.Keys) { |
||||
// remove the user AddIn
|
||||
string targetDir = Path.Combine(ICSharpCode.Core.AddInManager.UserAddInPath, identity); |
||||
if (Directory.Exists(targetDir)) { |
||||
if (!addIn.Enabled) { |
||||
try { |
||||
Directory.Delete(targetDir, true); |
||||
continue; |
||||
} catch { |
||||
} |
||||
} |
||||
ICSharpCode.Core.AddInManager.RemoveUserAddInOnNextStart(identity); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,945 +0,0 @@
@@ -1,945 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Drawing; |
||||
using System.IO; |
||||
using System.Text; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Core.WinForms; |
||||
using ICSharpCode.SharpDevelop; |
||||
|
||||
namespace ICSharpCode.AddInManager |
||||
{ |
||||
public class ManagerForm : System.Windows.Forms.Form |
||||
{ |
||||
#region Form Initialization
|
||||
static ManagerForm instance; |
||||
|
||||
public static ManagerForm Instance { |
||||
get { |
||||
return instance; |
||||
} |
||||
} |
||||
|
||||
public static void ShowForm() |
||||
{ |
||||
if (instance == null) { |
||||
instance = new ManagerForm(); |
||||
#if STANDALONE
|
||||
instance.Show(); |
||||
#else
|
||||
instance.Show(SD.WinForms.MainWin32Window); |
||||
#endif
|
||||
} else { |
||||
instance.Activate(); |
||||
} |
||||
} |
||||
|
||||
public ManagerForm() |
||||
{ |
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent(); |
||||
|
||||
#if !STANDALONE
|
||||
ICSharpCode.SharpDevelop.Gui.FormLocationHelper.Apply(this, "AddInManager.WindowBounds", true); |
||||
#endif
|
||||
|
||||
#if STANDALONE
|
||||
actionFlowLayoutPanel.BackgroundImage = new Bitmap(typeof(ManagerForm).Assembly.GetManifestResourceStream("ICSharpCode.AddInManager.WizardBackground.png")); |
||||
#else
|
||||
actionFlowLayoutPanel.BackgroundImage = WinFormsResourceService.GetBitmap("GeneralWizardBackground"); |
||||
#endif
|
||||
|
||||
installButton.Text = ResourceService.GetString("AddInManager.InstallButton"); |
||||
uninstallButton.Text = ResourceService.GetString("AddInManager.ActionUninstall"); |
||||
closeButton.Text = ResourceService.GetString("Global.CloseButtonText"); |
||||
showPreinstalledAddInsCheckBox.Text = ResourceService.GetString("AddInManager.ShowPreinstalledAddIns"); |
||||
this.Text = ResourceService.GetString("AddInManager.Title"); |
||||
RightToLeftConverter.ConvertRecursive(this); |
||||
|
||||
CreateAddInList(); |
||||
} |
||||
|
||||
void OnSplitContainerPanel1Paint(object sender, PaintEventArgs e) |
||||
{ |
||||
if (visibleAddInCount == 0) { |
||||
Rectangle rect = splitContainer.Panel1.ClientRectangle; |
||||
rect.Offset(16, 16); |
||||
rect.Inflate(-32, -32); |
||||
e.Graphics.DrawString(ResourceService.GetString("AddInManager.NoAddInsInstalled"), |
||||
Font, SystemBrushes.WindowText, rect); |
||||
} |
||||
} |
||||
|
||||
void CreateAddInList() |
||||
{ |
||||
Stack<AddInControl> stack = new Stack<AddInControl>(); |
||||
int index = 0; |
||||
AddInControl addInControl; |
||||
|
||||
List<AddIn> addInList = new List<AddIn>(SD.AddInTree.AddIns); |
||||
addInList.Sort(delegate(AddIn a, AddIn b) { |
||||
return a.Name.CompareTo(b.Name); |
||||
}); |
||||
bool hasPreinstalledAddIns = false; |
||||
foreach (AddIn addIn in addInList) { |
||||
if (string.Equals(addIn.Properties["addInManagerHidden"], "true", StringComparison.OrdinalIgnoreCase) |
||||
&& IsInstalledInApplicationRoot(addIn)) |
||||
{ |
||||
hasPreinstalledAddIns = true; |
||||
continue; |
||||
} |
||||
addInControl = new AddInControl(addIn); |
||||
addInControl.Dock = DockStyle.Top; |
||||
addInControl.TabIndex = index++; |
||||
stack.Push(addInControl); |
||||
addInControl.Enter += OnControlEnter; |
||||
addInControl.Click += OnControlClick; |
||||
} |
||||
while (stack.Count > 0) { |
||||
splitContainer.Panel1.Controls.Add(stack.Pop()); |
||||
} |
||||
ShowPreinstalledAddInsCheckBoxCheckedChanged(null, null); |
||||
if (!hasPreinstalledAddIns) { |
||||
showPreinstalledAddInsCheckBox.Visible = false; |
||||
} |
||||
splitContainer.Panel2Collapsed = true; |
||||
} |
||||
|
||||
void RefreshAddInList() |
||||
{ |
||||
List<AddIn> oldSelected = selected; |
||||
foreach (Control ctl in splitContainer.Panel1.Controls) { |
||||
ctl.Dispose(); |
||||
} |
||||
splitContainer.Panel1.Controls.Clear(); |
||||
CreateAddInList(); |
||||
if (oldSelected != null) { |
||||
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
||||
if (oldSelected.Contains(ctl.AddIn)) |
||||
ctl.Selected = true; |
||||
} |
||||
} |
||||
UpdateActionBox(); |
||||
} |
||||
#endregion
|
||||
|
||||
#region AddInList-Management
|
||||
int visibleAddInCount = 0; |
||||
|
||||
void ShowPreinstalledAddInsCheckBoxCheckedChanged(object sender, EventArgs e) |
||||
{ |
||||
visibleAddInCount = 0; |
||||
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
||||
ctl.Selected = false; |
||||
bool visible; |
||||
if (showPreinstalledAddInsCheckBox.Checked) { |
||||
visible = true; |
||||
} else { |
||||
if (ctl == oldFocus) |
||||
oldFocus = null; |
||||
if (IsInstalledInApplicationRoot(ctl.AddIn)) { |
||||
visible = !string.Equals(ctl.AddIn.Properties["addInManagerHidden"], "preinstalled", StringComparison.OrdinalIgnoreCase); |
||||
} else { |
||||
visible = true; |
||||
} |
||||
} |
||||
if (visible) |
||||
visibleAddInCount += 1; |
||||
ctl.Visible = visible; |
||||
} |
||||
UpdateActionBox(); |
||||
} |
||||
|
||||
static bool IsInstalledInApplicationRoot(AddIn addin) |
||||
{ |
||||
return FileUtility.IsBaseDirectory(FileUtility.ApplicationRootPath, addin.FileName); |
||||
} |
||||
|
||||
void OnControlClick(object sender, EventArgs e) |
||||
{ |
||||
// clicking again on already focused item:
|
||||
// remove selection of other items / or with Ctrl: toggle selection
|
||||
if (((Control)sender).Focused) |
||||
OnControlEnter(sender, e); |
||||
} |
||||
|
||||
AddInControl oldFocus; |
||||
bool ignoreFocusChange; |
||||
|
||||
void OnControlEnter(object sender, EventArgs e) |
||||
{ |
||||
if (ignoreFocusChange) |
||||
return; |
||||
bool ctrl = (ModifierKeys & Keys.Control) == Keys.Control; |
||||
if ((ModifierKeys & Keys.Shift) == Keys.Shift && sender != oldFocus) { |
||||
bool sel = false; |
||||
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
||||
if (!ctl.Visible) continue; |
||||
if (ctl == sender || ctl == oldFocus) { |
||||
sel = !sel; |
||||
ctl.Selected = true; |
||||
} else { |
||||
if (sel || !ctrl) { |
||||
ctl.Selected = sel; |
||||
} |
||||
} |
||||
} |
||||
} else if (ctrl) { |
||||
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
||||
if (ctl == sender) |
||||
ctl.Selected = !ctl.Selected; |
||||
} |
||||
oldFocus = (AddInControl)sender; |
||||
} else { |
||||
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
||||
ctl.Selected = ctl == sender; |
||||
} |
||||
oldFocus = (AddInControl)sender; |
||||
} |
||||
UpdateActionBox(); |
||||
} |
||||
#endregion
|
||||
|
||||
#region UpdateActionBox
|
||||
List<AddIn> selected; |
||||
AddInAction selectedAction; |
||||
|
||||
static bool IsErrorAction(AddInAction action) |
||||
{ |
||||
return action == AddInAction.DependencyError |
||||
|| action == AddInAction.InstalledTwice |
||||
|| action == AddInAction.CustomError; |
||||
} |
||||
|
||||
void UpdateActionBox() |
||||
{ |
||||
ignoreFocusChange = true; |
||||
selected = new List<AddIn>(); |
||||
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
||||
if (ctl.Selected) |
||||
selected.Add(ctl.AddIn); |
||||
} |
||||
splitContainer.Panel2Collapsed = selected.Count == 0; |
||||
if (selected.Count > 0) { |
||||
dependencyTable.Visible = false; |
||||
runActionButton.Visible = true; |
||||
uninstallButton.Visible = true; |
||||
|
||||
bool allHaveIdentity = true; |
||||
bool allEnabled = true; |
||||
bool allDisabled = true; |
||||
bool allInstalling = true; |
||||
bool allUninstalling = true; |
||||
bool allUpdating = true; |
||||
bool allUninstallable = true; |
||||
bool hasErrors = false; |
||||
foreach (AddIn addIn in selected) { |
||||
if (addIn.Manifest.PrimaryIdentity == null) { |
||||
allHaveIdentity = false; |
||||
break; |
||||
} |
||||
allEnabled &= addIn.Action == AddInAction.Enable; |
||||
if (IsErrorAction(addIn.Action)) |
||||
hasErrors = true; |
||||
else |
||||
allDisabled &= addIn.Action == AddInAction.Disable; |
||||
allUpdating &= addIn.Action == AddInAction.Update; |
||||
allInstalling &= addIn.Action == AddInAction.Install; |
||||
allUninstalling &= addIn.Action == AddInAction.Uninstall; |
||||
if (allUninstallable) { |
||||
if (IsInstalledInApplicationRoot(addIn)) { |
||||
allUninstallable = false; |
||||
} |
||||
} |
||||
} |
||||
if (allEnabled == true || allHaveIdentity == false) { |
||||
selectedAction = AddInAction.Disable; |
||||
actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionDisable"); |
||||
actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionDisable"); |
||||
if (allHaveIdentity) |
||||
runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Disable); |
||||
else |
||||
runActionButton.Enabled = false; |
||||
uninstallButton.Enabled = allUninstallable; |
||||
} else if (allDisabled) { |
||||
selectedAction = AddInAction.Enable; |
||||
actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionEnable"); |
||||
actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionEnable"); |
||||
runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Enable); |
||||
if (hasErrors) |
||||
runActionButton.Enabled = false; |
||||
uninstallButton.Enabled = allUninstallable; |
||||
} else if (allInstalling) { |
||||
selectedAction = AddInAction.Uninstall; |
||||
actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionCancelInstallation"); |
||||
actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionCancelInstall"); |
||||
runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Disable); |
||||
uninstallButton.Visible = false; |
||||
} else if (allUninstalling) { |
||||
selectedAction = AddInAction.Enable; |
||||
actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionCancelDeinstallation"); |
||||
actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionCancelDeinstallation"); |
||||
runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Enable); |
||||
uninstallButton.Visible = false; |
||||
} else if (allUpdating) { |
||||
selectedAction = AddInAction.InstalledTwice; |
||||
actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionCancelUpdate"); |
||||
actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionCancelUpdate"); |
||||
runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.CancelUpdate); |
||||
uninstallButton.Visible = false; |
||||
} else { |
||||
actionGroupBox.Text = ""; |
||||
actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionInconsistentSelection"); |
||||
runActionButton.Visible = false; |
||||
uninstallButton.Visible = false; |
||||
} |
||||
} |
||||
ignoreFocusChange = false; |
||||
} |
||||
|
||||
enum ShowDependencyMode { |
||||
Disable, |
||||
Enable, |
||||
CancelUpdate |
||||
} |
||||
|
||||
bool ShowDependencies(IList<AddIn> addIns, ShowDependencyMode mode) |
||||
{ |
||||
List<AddInReference> dependencies = new List<AddInReference>(); // only used with enable=true
|
||||
List<KeyValuePair<AddIn, AddInReference>> dependenciesToSel = new List<KeyValuePair<AddIn, AddInReference>>(); |
||||
Dictionary<string, Version> addInDict = new Dictionary<string, Version>(); |
||||
Dictionary<string, Version> modifiedAddIns = new Dictionary<string, Version>(); |
||||
|
||||
// add available addins
|
||||
foreach (AddIn addIn in SD.AddInTree.AddIns) { |
||||
if (addIn.Action != AddInAction.Enable && addIn.Action != AddInAction.Install) |
||||
continue; |
||||
if (addIns.Contains(addIn)) |
||||
continue; |
||||
foreach (KeyValuePair<string, Version> pair in addIn.Manifest.Identities) { |
||||
addInDict[pair.Key] = pair.Value; |
||||
} |
||||
} |
||||
|
||||
// create list of modified addin names
|
||||
foreach (AddIn addIn in addIns) { |
||||
foreach (KeyValuePair<string, Version> pair in addIn.Manifest.Identities) { |
||||
modifiedAddIns[pair.Key] = pair.Value; |
||||
} |
||||
} |
||||
|
||||
// add new addins
|
||||
if (mode != ShowDependencyMode.Disable) { |
||||
foreach (AddIn addIn in addIns) { |
||||
if (mode == ShowDependencyMode.CancelUpdate && !addIn.Enabled) { |
||||
continue; |
||||
} |
||||
foreach (KeyValuePair<string, Version> pair in addIn.Manifest.Identities) { |
||||
addInDict[pair.Key] = pair.Value; |
||||
} |
||||
foreach (AddInReference dep in addIn.Manifest.Dependencies) { |
||||
if (!dependencies.Contains(dep)) |
||||
dependencies.Add(dep); |
||||
} |
||||
} |
||||
} |
||||
|
||||
// add dependencies to the to-be-changed addins
|
||||
foreach (AddIn addIn in SD.AddInTree.AddIns) { |
||||
if (addIn.Action != AddInAction.Enable && addIn.Action != AddInAction.Install) |
||||
continue; |
||||
if (addIns.Contains(addIn)) |
||||
continue; |
||||
foreach (AddInReference dep in addIn.Manifest.Dependencies) { |
||||
if (modifiedAddIns.ContainsKey(dep.Name)) { |
||||
dependenciesToSel.Add(new KeyValuePair<AddIn, AddInReference>(addIn, dep)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
foreach (Control ctl in dependencyTable.Controls) { |
||||
ctl.Dispose(); |
||||
} |
||||
dependencyTable.Controls.Clear(); |
||||
bool allDepenciesOK = true; |
||||
if (dependencies.Count > 0 || dependenciesToSel.Count > 0) { |
||||
if (dependencies.Count == 0) { |
||||
dependencyTable.RowCount = 1 + dependenciesToSel.Count; |
||||
} else if (dependenciesToSel.Count == 0) { |
||||
dependencyTable.RowCount = 1 + dependencies.Count; |
||||
} else { |
||||
dependencyTable.RowCount = 2 + dependencies.Count + dependenciesToSel.Count; |
||||
} |
||||
while (dependencyTable.RowStyles.Count < dependencyTable.RowCount) { |
||||
dependencyTable.RowStyles.Add(new RowStyle(SizeType.AutoSize)); |
||||
} |
||||
int rowIndex = 0; |
||||
if (dependencies.Count > 0) { |
||||
AddLabelRow(rowIndex++, ResourceService.GetString("AddInManager.RequiredDependencies")); |
||||
foreach (AddInReference dep in dependencies) { |
||||
if (!AddDependencyRow(addInDict, dep, rowIndex++, null)) |
||||
allDepenciesOK = false; |
||||
} |
||||
} |
||||
if (dependenciesToSel.Count > 0) { |
||||
AddLabelRow(rowIndex++, ResourceService.GetString("AddInManager.RequiredBy")); |
||||
foreach (KeyValuePair<AddIn, AddInReference> pair in dependenciesToSel) { |
||||
if (!AddDependencyRow(addInDict, pair.Value, rowIndex++, pair.Key.Name)) |
||||
allDepenciesOK = false; |
||||
} |
||||
} |
||||
dependencyTable.Visible = true; |
||||
} |
||||
return allDepenciesOK; |
||||
} |
||||
|
||||
bool AddDependencyRow(Dictionary<string, Version> addInDict, AddInReference dep, int rowIndex, string requiredByName) |
||||
{ |
||||
string text = requiredByName ?? GetDisplayName(dep.Name); |
||||
Version versionFound; |
||||
Label label = new Label(); |
||||
label.AutoSize = true; |
||||
label.Text = text; |
||||
PictureBox box = new PictureBox(); |
||||
box.BorderStyle = BorderStyle.None; |
||||
box.Size = new Size(16, 16); |
||||
bool isOK = dep.Check(addInDict, out versionFound); |
||||
box.SizeMode = PictureBoxSizeMode.CenterImage; |
||||
box.Image = isOK ? WinFormsResourceService.GetBitmap("Icons.16x16.OK") : WinFormsResourceService.GetBitmap("Icons.16x16.DeleteIcon"); |
||||
dependencyTable.Controls.Add(label, 1, rowIndex); |
||||
dependencyTable.Controls.Add(box, 0, rowIndex); |
||||
return isOK; |
||||
} |
||||
|
||||
void AddLabelRow(int rowIndex, string text) |
||||
{ |
||||
Label label = new Label(); |
||||
label.AutoSize = true; |
||||
label.Text = text; |
||||
dependencyTable.Controls.Add(label, 0, rowIndex); |
||||
dependencyTable.SetColumnSpan(label, 2); |
||||
} |
||||
|
||||
string GetDisplayName(string identity) |
||||
{ |
||||
foreach (AddIn addIn in SD.AddInTree.AddIns) { |
||||
if (addIn.Manifest.Identities.ContainsKey(identity)) |
||||
return addIn.Name; |
||||
} |
||||
return identity; |
||||
} |
||||
#endregion
|
||||
|
||||
#region Install new AddIns
|
||||
void InstallButtonClick(object sender, EventArgs e) |
||||
{ |
||||
using (OpenFileDialog dlg = new OpenFileDialog()) { |
||||
dlg.Filter = ResourceService.GetString("AddInManager.FileFilter"); |
||||
dlg.Multiselect = true; |
||||
if (dlg.ShowDialog() == DialogResult.OK) { |
||||
if (ShowInstallableAddIns(dlg.FileNames)) { |
||||
if (runActionButton.Visible && runActionButton.Enabled) |
||||
runActionButton.PerformClick(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
public bool ShowInstallableAddIns(IEnumerable<string> fileNames) |
||||
{ |
||||
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
||||
ctl.Selected = false; |
||||
} |
||||
UpdateActionBox(); |
||||
List<InstallableAddIn> list = new List<InstallableAddIn>(); |
||||
foreach (string file in fileNames) { |
||||
try { |
||||
// Same file-extension check is in Panel1DragEnter
|
||||
switch (Path.GetExtension(file).ToLowerInvariant()) { |
||||
case ".addin": |
||||
if (FileUtility.IsBaseDirectory(FileUtility.ApplicationRootPath, file)) { |
||||
MessageService.ShowMessage("${res:AddInManager.CannotInstallIntoApplicationDirectory}"); |
||||
return false; |
||||
} |
||||
list.Add(new InstallableAddIn(file, false)); |
||||
break; |
||||
case ".sdaddin": |
||||
case ".zip": |
||||
list.Add(new InstallableAddIn(file, true)); |
||||
break; |
||||
default: |
||||
MessageService.ShowMessage("${res:AddInManager.UnknownFileFormat} " + Path.GetExtension(file)); |
||||
return false; |
||||
} |
||||
} catch (AddInLoadException ex) { |
||||
MessageService.ShowMessage("Error loading " + file + ":\n" + ex.Message); |
||||
return false; |
||||
} |
||||
} |
||||
ShowInstallableAddIns(list); |
||||
return true; |
||||
} |
||||
|
||||
IList<InstallableAddIn> shownAddInPackages; |
||||
|
||||
void ShowInstallableAddIns(IList<InstallableAddIn> addInPackages) |
||||
{ |
||||
shownAddInPackages = addInPackages; |
||||
ignoreFocusChange = true; |
||||
splitContainer.Panel2Collapsed = false; |
||||
dependencyTable.Visible = false; |
||||
runActionButton.Visible = true; |
||||
uninstallButton.Visible = false; |
||||
|
||||
selectedAction = AddInAction.Install; |
||||
List<string> installAddIns = new List<string>(); |
||||
List<string> updateAddIns = new List<string>(); |
||||
foreach (InstallableAddIn addInPackage in addInPackages) { |
||||
string identity = addInPackage.AddIn.Manifest.PrimaryIdentity; |
||||
AddIn foundAddIn = null; |
||||
foreach (AddIn addIn in SD.AddInTree.AddIns) { |
||||
if (addIn.Action != AddInAction.Install |
||||
&& addIn.Manifest.Identities.ContainsKey(identity)) |
||||
{ |
||||
foundAddIn = addIn; |
||||
break; |
||||
} |
||||
} |
||||
if (foundAddIn != null) { |
||||
updateAddIns.Add(addInPackage.AddIn.Name); |
||||
} else { |
||||
installAddIns.Add(addInPackage.AddIn.Name); |
||||
} |
||||
} |
||||
|
||||
if (updateAddIns.Count == 0) { |
||||
actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionInstall"); |
||||
} else if (installAddIns.Count == 0) { |
||||
actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionUpdate"); |
||||
} else { |
||||
actionGroupBox.Text = runActionButton.Text = |
||||
ResourceService.GetString("AddInManager.ActionInstall") |
||||
+ " + " + |
||||
ResourceService.GetString("AddInManager.ActionUpdate"); |
||||
} |
||||
List<AddIn> addInList = new List<AddIn>(); |
||||
StringBuilder b = new StringBuilder(); |
||||
if (installAddIns.Count == 1) { |
||||
b.Append("Installs the AddIn " + installAddIns[0]); |
||||
} else if (installAddIns.Count > 1) { |
||||
b.Append("Installs the AddIns " + string.Join(",", installAddIns.ToArray())); |
||||
} |
||||
if (updateAddIns.Count > 0 && installAddIns.Count > 0) |
||||
b.Append("; "); |
||||
if (updateAddIns.Count == 1) { |
||||
b.Append("Updates the AddIn " + updateAddIns[0]); |
||||
} else if (updateAddIns.Count > 1) { |
||||
b.Append("Updates the AddIns " + string.Join(",", updateAddIns.ToArray())); |
||||
} |
||||
actionDescription.Text = b.ToString(); |
||||
runActionButton.Enabled = ShowDependencies(addInList, ShowDependencyMode.Enable); |
||||
} |
||||
|
||||
void RunInstallation() |
||||
{ |
||||
// install new AddIns
|
||||
foreach (InstallableAddIn addInPackage in shownAddInPackages) { |
||||
string identity = addInPackage.AddIn.Manifest.PrimaryIdentity; |
||||
AddIn foundAddIn = null; |
||||
foreach (AddIn addIn in SD.AddInTree.AddIns) { |
||||
if (addIn.Manifest.Identities.ContainsKey(identity)) { |
||||
foundAddIn = addIn; |
||||
break; |
||||
} |
||||
} |
||||
if (foundAddIn != null) { |
||||
addInPackage.Install(true); |
||||
if (foundAddIn.Action != AddInAction.Enable) { |
||||
ICSharpCode.Core.AddInManager.Enable(new AddIn[] { foundAddIn }); |
||||
} |
||||
if (foundAddIn.Action != AddInAction.Install) { |
||||
foundAddIn.Action = AddInAction.Update; |
||||
} |
||||
} else { |
||||
addInPackage.Install(false); |
||||
} |
||||
} |
||||
RefreshAddInList(); |
||||
} |
||||
#endregion
|
||||
|
||||
#region Uninstall AddIns
|
||||
void UninstallButtonClick(object sender, EventArgs e) |
||||
{ |
||||
ICSharpCode.Core.AddInManager.RemoveExternalAddIns(selected); |
||||
InstallableAddIn.Uninstall(selected); |
||||
RefreshAddInList(); |
||||
} |
||||
#endregion
|
||||
|
||||
#region Drag'N'Drop
|
||||
void Panel1DragEnter(object sender, DragEventArgs e) |
||||
{ |
||||
if (!e.Data.GetDataPresent(DataFormats.FileDrop)) { |
||||
e.Effect = DragDropEffects.None; |
||||
return; |
||||
} |
||||
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); |
||||
int addInCount = 0; |
||||
int packageCount = 0; |
||||
foreach (string file in files) { |
||||
switch (Path.GetExtension(file).ToLowerInvariant()) { |
||||
case ".addin": |
||||
addInCount += 1; |
||||
break; |
||||
case ".sdaddin": |
||||
case ".zip": |
||||
packageCount += 1; |
||||
break; |
||||
default: |
||||
e.Effect = DragDropEffects.None; |
||||
return; |
||||
} |
||||
} |
||||
if (addInCount == 0 && packageCount == 0) { |
||||
e.Effect = DragDropEffects.None; |
||||
} else if (addInCount == 0) { |
||||
e.Effect = DragDropEffects.Copy; |
||||
} else { |
||||
e.Effect = DragDropEffects.Link; |
||||
} |
||||
} |
||||
|
||||
void Panel1DragDrop(object sender, DragEventArgs e) |
||||
{ |
||||
if (!e.Data.GetDataPresent(DataFormats.FileDrop)) |
||||
return; |
||||
ShowInstallableAddIns((string[])e.Data.GetData(DataFormats.FileDrop)); |
||||
} |
||||
#endregion
|
||||
|
||||
void CloseButtonClick(object sender, EventArgs e) |
||||
{ |
||||
Close(); |
||||
} |
||||
|
||||
protected override void OnClosed(EventArgs e) |
||||
{ |
||||
base.OnClosed(e); |
||||
instance = null; |
||||
} |
||||
|
||||
public void TryRunAction(AddIn addIn, AddInAction action) |
||||
{ |
||||
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
||||
ctl.Selected = ctl.AddIn == addIn; |
||||
} |
||||
UpdateActionBox(); |
||||
if (selectedAction == action && runActionButton.Visible && runActionButton.Enabled) |
||||
runActionButton.PerformClick(); |
||||
} |
||||
|
||||
public void TryUninstall(AddIn addIn) |
||||
{ |
||||
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
||||
ctl.Selected = ctl.AddIn == addIn; |
||||
} |
||||
UpdateActionBox(); |
||||
if (uninstallButton.Visible && uninstallButton.Enabled) |
||||
uninstallButton.PerformClick(); |
||||
} |
||||
|
||||
void RunActionButtonClick(object sender, EventArgs e) |
||||
{ |
||||
switch (selectedAction) { |
||||
case AddInAction.Disable: |
||||
for (int i = 0; i < selected.Count; i++) { |
||||
if (selected[i].Manifest.PrimaryIdentity == "ICSharpCode.AddInManager") { |
||||
MessageService.ShowMessage("${res:AddInManager.CannotDisableAddInManager}"); |
||||
selected.RemoveAt(i--); |
||||
} |
||||
} |
||||
ICSharpCode.Core.AddInManager.Disable(selected); |
||||
break; |
||||
case AddInAction.Enable: |
||||
ICSharpCode.Core.AddInManager.Enable(selected); |
||||
break; |
||||
case AddInAction.Install: |
||||
RunInstallation(); |
||||
return; |
||||
case AddInAction.Uninstall: |
||||
UninstallButtonClick(sender, e); |
||||
return; |
||||
case AddInAction.InstalledTwice: // used to cancel installation of update
|
||||
InstallableAddIn.CancelUpdate(selected); |
||||
foreach (AddIn addIn in selected) { |
||||
addIn.Action = addIn.Enabled ? AddInAction.Enable : AddInAction.Disable; |
||||
} |
||||
break; |
||||
default: |
||||
throw new NotImplementedException(); |
||||
} |
||||
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
||||
ctl.Invalidate(); |
||||
} |
||||
UpdateActionBox(); |
||||
} |
||||
|
||||
#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() |
||||
{ |
||||
this.topPanel = new System.Windows.Forms.Panel(); |
||||
this.bottomPanel = new System.Windows.Forms.Panel(); |
||||
this.installButton = new System.Windows.Forms.Button(); |
||||
this.closeButton = new System.Windows.Forms.Button(); |
||||
this.showPreinstalledAddInsCheckBox = new System.Windows.Forms.CheckBox(); |
||||
this.splitContainer = new System.Windows.Forms.SplitContainer(); |
||||
this.actionGroupBox = new System.Windows.Forms.GroupBox(); |
||||
this.actionFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); |
||||
this.actionDescription = new System.Windows.Forms.Label(); |
||||
this.dependencyTable = new System.Windows.Forms.TableLayoutPanel(); |
||||
this.dummyLabel1 = new System.Windows.Forms.Label(); |
||||
this.dummyLabel2 = new System.Windows.Forms.Label(); |
||||
this.runActionButton = new System.Windows.Forms.Button(); |
||||
this.uninstallButton = new System.Windows.Forms.Button(); |
||||
this.bottomPanel.SuspendLayout(); |
||||
this.splitContainer.Panel2.SuspendLayout(); |
||||
this.splitContainer.SuspendLayout(); |
||||
this.actionGroupBox.SuspendLayout(); |
||||
this.actionFlowLayoutPanel.SuspendLayout(); |
||||
this.dependencyTable.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// topPanel
|
||||
//
|
||||
this.topPanel.Dock = System.Windows.Forms.DockStyle.Top; |
||||
this.topPanel.Location = new System.Drawing.Point(0, 0); |
||||
this.topPanel.Name = "topPanel"; |
||||
this.topPanel.Size = new System.Drawing.Size(460, 33); |
||||
this.topPanel.TabIndex = 1; |
||||
this.topPanel.Visible = false; |
||||
//
|
||||
// bottomPanel
|
||||
//
|
||||
this.bottomPanel.Controls.Add(this.installButton); |
||||
this.bottomPanel.Controls.Add(this.closeButton); |
||||
this.bottomPanel.Controls.Add(this.showPreinstalledAddInsCheckBox); |
||||
this.bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom; |
||||
this.bottomPanel.Location = new System.Drawing.Point(0, 355); |
||||
this.bottomPanel.Name = "bottomPanel"; |
||||
this.bottomPanel.Size = new System.Drawing.Size(460, 35); |
||||
this.bottomPanel.TabIndex = 0; |
||||
//
|
||||
// installButton
|
||||
//
|
||||
this.installButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); |
||||
this.installButton.Location = new System.Drawing.Point(274, 6); |
||||
this.installButton.Name = "installButton"; |
||||
this.installButton.Size = new System.Drawing.Size(93, 23); |
||||
this.installButton.TabIndex = 1; |
||||
this.installButton.Text = "Install AddIn"; |
||||
this.installButton.UseCompatibleTextRendering = true; |
||||
this.installButton.UseVisualStyleBackColor = true; |
||||
this.installButton.Click += new System.EventHandler(this.InstallButtonClick); |
||||
//
|
||||
// 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(373, 6); |
||||
this.closeButton.Name = "closeButton"; |
||||
this.closeButton.Size = new System.Drawing.Size(75, 23); |
||||
this.closeButton.TabIndex = 2; |
||||
this.closeButton.Text = "Close"; |
||||
this.closeButton.UseCompatibleTextRendering = true; |
||||
this.closeButton.UseVisualStyleBackColor = true; |
||||
this.closeButton.Click += new System.EventHandler(this.CloseButtonClick); |
||||
//
|
||||
// showPreinstalledAddInsCheckBox
|
||||
//
|
||||
this.showPreinstalledAddInsCheckBox.Location = new System.Drawing.Point(3, 6); |
||||
this.showPreinstalledAddInsCheckBox.Name = "showPreinstalledAddInsCheckBox"; |
||||
this.showPreinstalledAddInsCheckBox.Size = new System.Drawing.Size(169, 24); |
||||
this.showPreinstalledAddInsCheckBox.TabIndex = 0; |
||||
this.showPreinstalledAddInsCheckBox.Text = "Show preinstalled AddIns"; |
||||
this.showPreinstalledAddInsCheckBox.UseCompatibleTextRendering = true; |
||||
this.showPreinstalledAddInsCheckBox.UseVisualStyleBackColor = true; |
||||
this.showPreinstalledAddInsCheckBox.CheckedChanged += new System.EventHandler(this.ShowPreinstalledAddInsCheckBoxCheckedChanged); |
||||
//
|
||||
// splitContainer
|
||||
//
|
||||
this.splitContainer.BackColor = System.Drawing.SystemColors.Window; |
||||
this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; |
||||
this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; |
||||
this.splitContainer.Location = new System.Drawing.Point(0, 33); |
||||
this.splitContainer.Name = "splitContainer"; |
||||
//
|
||||
// splitContainer.Panel1
|
||||
//
|
||||
this.splitContainer.Panel1.AllowDrop = true; |
||||
this.splitContainer.Panel1.AutoScroll = true; |
||||
this.splitContainer.Panel1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Panel1DragDrop); |
||||
this.splitContainer.Panel1.DragEnter += new System.Windows.Forms.DragEventHandler(this.Panel1DragEnter); |
||||
this.splitContainer.Panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.OnSplitContainerPanel1Paint); |
||||
this.splitContainer.Panel1MinSize = 100; |
||||
//
|
||||
// splitContainer.Panel2
|
||||
//
|
||||
this.splitContainer.Panel2.Controls.Add(this.actionGroupBox); |
||||
this.splitContainer.Panel2MinSize = 100; |
||||
this.splitContainer.Size = new System.Drawing.Size(460, 322); |
||||
this.splitContainer.SplitterDistance = 248; |
||||
this.splitContainer.TabIndex = 2; |
||||
//
|
||||
// actionGroupBox
|
||||
//
|
||||
this.actionGroupBox.Controls.Add(this.actionFlowLayoutPanel); |
||||
this.actionGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; |
||||
this.actionGroupBox.Location = new System.Drawing.Point(0, 0); |
||||
this.actionGroupBox.Name = "actionGroupBox"; |
||||
this.actionGroupBox.Size = new System.Drawing.Size(208, 322); |
||||
this.actionGroupBox.TabIndex = 0; |
||||
this.actionGroupBox.TabStop = false; |
||||
this.actionGroupBox.Text = "actionGroupBox"; |
||||
this.actionGroupBox.UseCompatibleTextRendering = true; |
||||
//
|
||||
// actionFlowLayoutPanel
|
||||
//
|
||||
this.actionFlowLayoutPanel.AutoScroll = true; |
||||
this.actionFlowLayoutPanel.Controls.Add(this.actionDescription); |
||||
this.actionFlowLayoutPanel.Controls.Add(this.dependencyTable); |
||||
this.actionFlowLayoutPanel.Controls.Add(this.runActionButton); |
||||
this.actionFlowLayoutPanel.Controls.Add(this.uninstallButton); |
||||
this.actionFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; |
||||
this.actionFlowLayoutPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; |
||||
this.actionFlowLayoutPanel.ForeColor = System.Drawing.SystemColors.WindowText; |
||||
this.actionFlowLayoutPanel.Location = new System.Drawing.Point(3, 17); |
||||
this.actionFlowLayoutPanel.Name = "actionFlowLayoutPanel"; |
||||
this.actionFlowLayoutPanel.Size = new System.Drawing.Size(202, 302); |
||||
this.actionFlowLayoutPanel.TabIndex = 0; |
||||
this.actionFlowLayoutPanel.WrapContents = false; |
||||
//
|
||||
// actionDescription
|
||||
//
|
||||
this.actionDescription.AutoSize = true; |
||||
this.actionDescription.Location = new System.Drawing.Point(3, 0); |
||||
this.actionDescription.Name = "actionDescription"; |
||||
this.actionDescription.Size = new System.Drawing.Size(90, 18); |
||||
this.actionDescription.TabIndex = 0; |
||||
this.actionDescription.Text = "actionDescription"; |
||||
this.actionDescription.UseCompatibleTextRendering = true; |
||||
//
|
||||
// dependencyTable
|
||||
//
|
||||
this.dependencyTable.AutoSize = true; |
||||
this.dependencyTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; |
||||
this.dependencyTable.ColumnCount = 2; |
||||
this.dependencyTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); |
||||
this.dependencyTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); |
||||
this.dependencyTable.Controls.Add(this.dummyLabel1, 1, 0); |
||||
this.dependencyTable.Controls.Add(this.dummyLabel2, 1, 1); |
||||
this.dependencyTable.Location = new System.Drawing.Point(3, 21); |
||||
this.dependencyTable.Name = "dependencyTable"; |
||||
this.dependencyTable.RowCount = 2; |
||||
this.dependencyTable.RowStyles.Add(new System.Windows.Forms.RowStyle()); |
||||
this.dependencyTable.RowStyles.Add(new System.Windows.Forms.RowStyle()); |
||||
this.dependencyTable.Size = new System.Drawing.Size(55, 36); |
||||
this.dependencyTable.TabIndex = 1; |
||||
//
|
||||
// dummyLabel1
|
||||
//
|
||||
this.dummyLabel1.AutoSize = true; |
||||
this.dummyLabel1.Location = new System.Drawing.Point(23, 0); |
||||
this.dummyLabel1.Name = "dummyLabel1"; |
||||
this.dummyLabel1.Size = new System.Drawing.Size(29, 18); |
||||
this.dummyLabel1.TabIndex = 0; |
||||
this.dummyLabel1.Text = "dep1"; |
||||
this.dummyLabel1.UseCompatibleTextRendering = true; |
||||
//
|
||||
// dummyLabel2
|
||||
//
|
||||
this.dummyLabel2.AutoSize = true; |
||||
this.dummyLabel2.Location = new System.Drawing.Point(23, 18); |
||||
this.dummyLabel2.Name = "dummyLabel2"; |
||||
this.dummyLabel2.Size = new System.Drawing.Size(29, 18); |
||||
this.dummyLabel2.TabIndex = 1; |
||||
this.dummyLabel2.Text = "dep2"; |
||||
this.dummyLabel2.UseCompatibleTextRendering = true; |
||||
//
|
||||
// runActionButton
|
||||
//
|
||||
this.runActionButton.AutoSize = true; |
||||
this.runActionButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; |
||||
this.runActionButton.Location = new System.Drawing.Point(3, 63); |
||||
this.runActionButton.MinimumSize = new System.Drawing.Size(91, 25); |
||||
this.runActionButton.Name = "runActionButton"; |
||||
this.runActionButton.Size = new System.Drawing.Size(91, 25); |
||||
this.runActionButton.TabIndex = 2; |
||||
this.runActionButton.Text = "runAction"; |
||||
this.runActionButton.UseCompatibleTextRendering = true; |
||||
this.runActionButton.UseVisualStyleBackColor = true; |
||||
this.runActionButton.Click += new System.EventHandler(this.RunActionButtonClick); |
||||
//
|
||||
// uninstallButton
|
||||
//
|
||||
this.uninstallButton.AutoSize = true; |
||||
this.uninstallButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; |
||||
this.uninstallButton.Location = new System.Drawing.Point(3, 94); |
||||
this.uninstallButton.MinimumSize = new System.Drawing.Size(91, 25); |
||||
this.uninstallButton.Name = "uninstallButton"; |
||||
this.uninstallButton.Size = new System.Drawing.Size(91, 25); |
||||
this.uninstallButton.TabIndex = 3; |
||||
this.uninstallButton.Text = "Uninstall"; |
||||
this.uninstallButton.UseCompatibleTextRendering = true; |
||||
this.uninstallButton.UseVisualStyleBackColor = true; |
||||
this.uninstallButton.Click += new System.EventHandler(this.UninstallButtonClick); |
||||
//
|
||||
// ManagerForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.ClientSize = new System.Drawing.Size(460, 390); |
||||
this.Controls.Add(this.splitContainer); |
||||
this.Controls.Add(this.bottomPanel); |
||||
this.Controls.Add(this.topPanel); |
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; |
||||
this.MinimumSize = new System.Drawing.Size(250, 200); |
||||
this.Name = "ManagerForm"; |
||||
this.Text = "AddIn Manager"; |
||||
this.bottomPanel.ResumeLayout(false); |
||||
this.splitContainer.Panel2.ResumeLayout(false); |
||||
this.splitContainer.ResumeLayout(false); |
||||
this.actionGroupBox.ResumeLayout(false); |
||||
this.actionFlowLayoutPanel.ResumeLayout(false); |
||||
this.actionFlowLayoutPanel.PerformLayout(); |
||||
this.dependencyTable.ResumeLayout(false); |
||||
this.dependencyTable.PerformLayout(); |
||||
this.ResumeLayout(false); |
||||
} |
||||
private System.Windows.Forms.Label dummyLabel2; |
||||
private System.Windows.Forms.Label dummyLabel1; |
||||
private System.Windows.Forms.CheckBox showPreinstalledAddInsCheckBox; |
||||
private System.Windows.Forms.Button installButton; |
||||
private System.Windows.Forms.Button uninstallButton; |
||||
private System.Windows.Forms.Button runActionButton; |
||||
private System.Windows.Forms.TableLayoutPanel dependencyTable; |
||||
private System.Windows.Forms.Label actionDescription; |
||||
private System.Windows.Forms.FlowLayoutPanel actionFlowLayoutPanel; |
||||
private System.Windows.Forms.GroupBox actionGroupBox; |
||||
private System.Windows.Forms.Button closeButton; |
||||
private System.Windows.Forms.SplitContainer splitContainer; |
||||
private System.Windows.Forms.Panel bottomPanel; |
||||
private System.Windows.Forms.Panel topPanel; |
||||
#endregion
|
||||
} |
||||
} |
@ -1,120 +0,0 @@
@@ -1,120 +0,0 @@
|
||||
<?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> |
||||
</root> |
Binary file not shown.
Loading…
Reference in new issue