21 changed files with 375 additions and 96 deletions
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
#region Using directives
|
||||
|
||||
using System; |
||||
using System.Reflection; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
#endregion
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("${ProjectName}")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("${ProjectName}")] |
||||
[assembly: AssemblyCopyright("Copyright ${DATE:yyyy}")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all the values or you can use the default the Revision and
|
||||
// Build Numbers by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.*")] |
@ -0,0 +1,54 @@
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0"?> |
||||
<Template originator = "Daniel Grunwald" created = "05/17/2012"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>Portable Library</Name> |
||||
<Category>C#</Category> |
||||
<Icon>C#.Project.Library</Icon> |
||||
<Description>Library that can be used on Windows, Silverlight, Windows Phone, and Xbox.</Description> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "MyClass.cs"/> |
||||
</Actions> |
||||
|
||||
<!-- Template Content --> |
||||
<Project language="C#"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
||||
<TargetFrameworkProfile>Profile1</TargetFrameworkProfile> |
||||
</PropertyGroup> |
||||
|
||||
<PropertyGroup escapeValue="False"> |
||||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
||||
</PropertyGroup> |
||||
|
||||
<ProjectItems /> |
||||
|
||||
<Imports clear="True"> |
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> |
||||
</Imports> |
||||
|
||||
<Files> |
||||
<File name="MyClass.cs"><![CDATA[${StandardHeader.C#} |
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
/// <summary> |
||||
/// Description of MyClass. |
||||
/// </summary> |
||||
public class MyClass |
||||
{ |
||||
|
||||
} |
||||
}]]></File> |
||||
<File name="Properties\AssemblyInfo.cs" src="PortableAssemblyInfo.cs"/> |
||||
</Files> |
||||
</Project> |
||||
</Template> |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
// 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; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
using System.Linq; |
||||
using ICSharpCode.SharpDevelop.Project.Converter; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Project.PortableLibrary |
||||
{ |
||||
public class PortableLibraryProjectBehavior : ProjectBehavior |
||||
{ |
||||
public readonly static TargetFramework PortableTargetFramework = new TargetFramework("v4.0Portable", "Portable Library") { |
||||
MinimumMSBuildVersion = new Version(4, 0) |
||||
}; |
||||
|
||||
public override IEnumerable<CompilerVersion> GetAvailableCompilerVersions() |
||||
{ |
||||
return base.GetAvailableCompilerVersions().Where(c => c.MSBuildVersion == new Version(4, 0)); |
||||
} |
||||
|
||||
public override IEnumerable<TargetFramework> GetAvailableTargetFrameworks() |
||||
{ |
||||
return new[] { PortableTargetFramework }; |
||||
} |
||||
|
||||
public override TargetFramework CurrentTargetFramework { |
||||
get { return PortableTargetFramework; } |
||||
} |
||||
|
||||
public override void UpgradeProject(CompilerVersion newVersion, TargetFramework newFramework) |
||||
{ |
||||
// can't upgrade portable libraries
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
// 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; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Project.PortableLibrary |
||||
{ |
||||
/// <summary>
|
||||
/// Description of Profile.
|
||||
/// </summary>
|
||||
public class Profile |
||||
{ |
||||
#region Load List of Profiles
|
||||
static string GetPortableLibraryPath() |
||||
{ |
||||
string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); |
||||
return Path.Combine(programFiles, @"Reference Assemblies\Microsoft\Framework\.NETPortable"); |
||||
} |
||||
|
||||
public static IList<Profile> LoadProfiles() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public static bool IsPortableLibraryInstalled() |
||||
{ |
||||
return Directory.Exists(GetPortableLibraryPath()); |
||||
} |
||||
#endregion
|
||||
|
||||
public readonly string TargetFrameworkVersion; |
||||
public readonly string TargetFrameworkProfile; |
||||
public readonly IList<SupportedFramework> SupportedFrameworks; |
||||
|
||||
public Profile(string targetFrameworkVersion, string targetFrameworkProfile, IList<SupportedFramework> supportedFrameworks) |
||||
{ |
||||
this.TargetFrameworkVersion = targetFrameworkVersion; |
||||
this.TargetFrameworkProfile = targetFrameworkProfile; |
||||
this.SupportedFrameworks = supportedFrameworks; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
// 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.Xml.Linq; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Project.PortableLibrary |
||||
{ |
||||
/// <summary>
|
||||
/// A supported framework.
|
||||
/// </summary>
|
||||
public class SupportedFramework |
||||
{ |
||||
public readonly string Identifier; |
||||
public readonly string Profile; |
||||
public readonly Version MinimumVersion; |
||||
public readonly string DisplayName; |
||||
|
||||
public SupportedFramework(XElement framework) |
||||
{ |
||||
this.Identifier = (string)framework.Attribute("Identifier"); |
||||
this.Profile = (string)framework.Attribute("Profile"); |
||||
Version.TryParse((string)framework.Attribute("MinimumVersion"), out MinimumVersion); |
||||
string displayName = (string)framework.Attribute("DisplayName"); |
||||
string minimumVersionDisplayName = (string)framework.Attribute("MinimumVersionDisplayName"); |
||||
if (!string.IsNullOrEmpty(minimumVersionDisplayName)) |
||||
displayName += " " + minimumVersionDisplayName; |
||||
this.DisplayName = displayName; |
||||
} |
||||
|
||||
public override string ToString() |
||||
{ |
||||
return this.DisplayName; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue