Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4004 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
3 changed files with 216 additions and 0 deletions
@ -0,0 +1,192 @@
@@ -0,0 +1,192 @@
|
||||
<Template originator = "Ivan Shumilin" created = "20/04/2009"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>Silverlight Application</Name> |
||||
<Category>C#</Category> |
||||
<Subcategory>Silverlight</Subcategory> |
||||
<Icon>C#.Project.Form</Icon> |
||||
<Description>Default Silverlight 3.0 Application</Description> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "MainPage.xaml"/> |
||||
</Actions> |
||||
|
||||
<Project language = "C#"> |
||||
|
||||
<ProjectItems> |
||||
<Reference Include="System.Windows" /> |
||||
<Reference Include="mscorlib" /> |
||||
<Reference Include="system" /> |
||||
<Reference Include="System.Core" /> |
||||
<Reference Include="System.Net" /> |
||||
<Reference Include="System.Xml" /> |
||||
<Reference Include="System.Windows.Browser" /> |
||||
</ProjectItems> |
||||
|
||||
<PropertyGroup> |
||||
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> |
||||
<OutputType>Library</OutputType> |
||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||
<RootNamespace>${StandardNamespace}</RootNamespace> |
||||
<AssemblyName>${StandardNamespace}</AssemblyName> |
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
||||
<SilverlightApplication>true</SilverlightApplication> |
||||
<SupportedCultures> |
||||
</SupportedCultures> |
||||
<XapOutputs>true</XapOutputs> |
||||
<GenerateSilverlightManifest>true</GenerateSilverlightManifest> |
||||
<XapFilename>${StandardNamespace}.xap</XapFilename> |
||||
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate> |
||||
<SilverlightAppEntry>${StandardNamespace}.App</SilverlightAppEntry> |
||||
<TestPageFileName>TestPage.html</TestPageFileName> |
||||
<CreateTestPage>true</CreateTestPage> |
||||
<ValidateXaml>true</ValidateXaml> |
||||
<UsePlatformExtensions>false</UsePlatformExtensions> |
||||
<ThrowErrorsInValidation>true</ThrowErrorsInValidation> |
||||
<NoStdLib>true</NoStdLib> |
||||
<NoConfig>true</NoConfig> |
||||
</PropertyGroup> |
||||
|
||||
<PropertyGroup configuration="Debug" escapeValue="false"> |
||||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants> |
||||
</PropertyGroup> |
||||
|
||||
<PropertyGroup configuration="Release" escapeValue="false"> |
||||
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants> |
||||
</PropertyGroup> |
||||
|
||||
<Imports clear="True"> |
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" /> |
||||
</Imports> |
||||
|
||||
<Files> |
||||
|
||||
<File name="App.xaml" buildAction="ApplicationDefinition" language="XML"><![CDATA[<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
x:Class="${StandardNamespace}.App" |
||||
> |
||||
<Application.Resources> |
||||
|
||||
</Application.Resources> |
||||
</Application>]]></File> |
||||
|
||||
<File name="App.xaml.cs" SubType="Code" DependentUpon="App.xaml"><![CDATA[using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Net; |
||||
using System.Windows; |
||||
using System.Windows.Controls; |
||||
using System.Windows.Documents; |
||||
using System.Windows.Input; |
||||
using System.Windows.Media; |
||||
using System.Windows.Media.Animation; |
||||
using System.Windows.Shapes; |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
public partial class App : Application |
||||
{ |
||||
public App() |
||||
{ |
||||
this.Startup += this.Application_Startup; |
||||
this.Exit += this.Application_Exit; |
||||
this.UnhandledException += this.Application_UnhandledException; |
||||
|
||||
InitializeComponent(); |
||||
} |
||||
|
||||
private void Application_Startup(object sender, StartupEventArgs e) |
||||
{ |
||||
this.RootVisual = new MainPage(); |
||||
} |
||||
|
||||
private void Application_Exit(object sender, EventArgs e) |
||||
{ |
||||
|
||||
} |
||||
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) |
||||
{ |
||||
// If the app is running outside of the debugger then report the exception using |
||||
// the browser's exception mechanism. On IE this will display it a yellow alert |
||||
// icon in the status bar and Firefox will display a script error. |
||||
if (!System.Diagnostics.Debugger.IsAttached) { |
||||
|
||||
// NOTE: This will allow the application to continue running after an exception has been thrown |
||||
// but not handled. |
||||
// For production applications this error handling should be replaced with something that will |
||||
// report the error to the website and stop the application. |
||||
e.Handled = true; |
||||
Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); |
||||
} |
||||
} |
||||
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) |
||||
{ |
||||
try { |
||||
string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; |
||||
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); |
||||
|
||||
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); |
||||
} |
||||
catch (Exception) { |
||||
} |
||||
} |
||||
} |
||||
}]]></File> |
||||
|
||||
<File name="MainPage.xaml" buildAction="Page" language="XML"><![CDATA[<UserControl x:Class="${StandardNamespace}.MainPage" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
Width="400" Height="300"> |
||||
<Grid x:Name="LayoutRoot" Background="White"> |
||||
|
||||
</Grid> |
||||
</UserControl>]]></File> |
||||
|
||||
<File name="MainPage.xaml.cs" SubType="Code" DependentUpon="MainPage.xaml"><![CDATA[using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Net; |
||||
using System.Windows; |
||||
using System.Windows.Controls; |
||||
using System.Windows.Documents; |
||||
using System.Windows.Input; |
||||
using System.Windows.Media; |
||||
using System.Windows.Media.Animation; |
||||
using System.Windows.Shapes; |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
public partial class MainPage : UserControl |
||||
{ |
||||
public MainPage() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
} |
||||
}]]></File> |
||||
|
||||
<File name="Properties\AppManifest.xml"><![CDATA[<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
> |
||||
<Deployment.Parts> |
||||
</Deployment.Parts> |
||||
|
||||
<!-- Uncomment the markup and update the fields below to make your application offline enabled |
||||
<Deployment.ApplicationIdentity> |
||||
<ApplicationIdentity |
||||
ShortName="Out of Browser Silverlight Application" |
||||
Title="Window Title of Your Silverlight Application"> |
||||
<ApplicationIdentity.Blurb>Description of your Silverlight application</ApplicationIdentity.Blurb> |
||||
</ApplicationIdentity> |
||||
</Deployment.ApplicationIdentity> |
||||
--> |
||||
</Deployment>]]></File> |
||||
|
||||
<File name="Properties\AssemblyInfo.cs" src="DefaultAssemblyInfo.cs" /> |
||||
|
||||
</Files> |
||||
</Project> |
||||
</Template> |
Loading…
Reference in new issue