Skip to content

Commit 440e16a

Browse files
committed
Added 49th post.
1 parent e54f163 commit 440e16a

File tree

49 files changed

+31105
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+31105
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
x:Class="ExpandTreeViewSilverlight.App"
4+
>
5+
<Application.Resources>
6+
7+
</Application.Resources>
8+
</Application>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Net;
5+
using System.Windows;
6+
using System.Windows.Controls;
7+
using System.Windows.Documents;
8+
using System.Windows.Input;
9+
using System.Windows.Media;
10+
using System.Windows.Media.Animation;
11+
using System.Windows.Shapes;
12+
13+
namespace ExpandTreeViewSilverlight
14+
{
15+
public partial class App : Application
16+
{
17+
18+
public App()
19+
{
20+
this.Startup += this.Application_Startup;
21+
this.Exit += this.Application_Exit;
22+
this.UnhandledException += this.Application_UnhandledException;
23+
24+
InitializeComponent();
25+
}
26+
27+
private void Application_Startup(object sender, StartupEventArgs e)
28+
{
29+
this.RootVisual = new Page();
30+
}
31+
32+
private void Application_Exit(object sender, EventArgs e)
33+
{
34+
35+
}
36+
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
37+
{
38+
// If the app is running outside of the debugger then report the exception using
39+
// the browser's exception mechanism. On IE this will display it a yellow alert
40+
// icon in the status bar and Firefox will display a script error.
41+
if (!System.Diagnostics.Debugger.IsAttached)
42+
{
43+
44+
// NOTE: This will allow the application to continue running after an exception has been thrown
45+
// but not handled.
46+
// For production applications this error handling should be replaced with something that will
47+
// report the error to the website and stop the application.
48+
e.Handled = true;
49+
Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
50+
}
51+
}
52+
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
53+
{
54+
try
55+
{
56+
string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
57+
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
58+
59+
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application " + errorMsg + "\");");
60+
}
61+
catch (Exception)
62+
{
63+
}
64+
}
65+
}
66+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
using System.Collections.ObjectModel;
2+
using System.Globalization;
3+
using System.Windows.Markup;
4+
5+
namespace ExpandTreeViewSilverlight
6+
{
7+
/// <summary>
8+
/// Represents an item contained in a level of a Linnaean taxonomy.
9+
/// </summary>
10+
[ContentProperty("Subclasses")]
11+
public abstract class Taxonomy
12+
{
13+
/// <summary>
14+
/// Gets the name of the TaxonomicRank.
15+
/// </summary>
16+
public string Rank
17+
{
18+
get { return GetType().Name; }
19+
}
20+
21+
/// <summary>
22+
/// Gets or sets the classification of the item being ranked.
23+
/// </summary>
24+
public string Classification { get; set; }
25+
26+
/// <summary>
27+
/// Gets the subclasses of of the item being ranked.
28+
/// </summary>
29+
public Collection<Taxonomy> Subclasses { get; private set; }
30+
31+
/// <summary>
32+
/// Initializes a new instance of the TaxonomicItem class.
33+
/// </summary>
34+
protected Taxonomy()
35+
{
36+
Subclasses = new Collection<Taxonomy>();
37+
}
38+
39+
/// <summary>
40+
/// Get a string representation of the TaxonomicItem.
41+
/// </summary>
42+
/// <returns>String representation of the TaxonomicItem.</returns>
43+
public override string ToString()
44+
{
45+
return string.Format(CultureInfo.InvariantCulture, "{0}: {1}", Rank, Classification);
46+
}
47+
}
48+
49+
/// <summary>
50+
/// Represents a Domain in a Linnaean taxonomy.
51+
/// </summary>
52+
public sealed class Domain : Taxonomy
53+
{
54+
}
55+
56+
/// <summary>
57+
/// Represents a Kingdom in a Linnaean taxonomy.
58+
/// </summary>
59+
public sealed class Kingdom : Taxonomy
60+
{
61+
}
62+
63+
/// <summary>
64+
/// Represents a Class in a Linnaean taxonomy.
65+
/// </summary>
66+
public sealed class Class : Taxonomy
67+
{
68+
}
69+
70+
/// <summary>
71+
/// Represents a Family in a Linnaean taxonomy.
72+
/// </summary>
73+
public sealed class Family : Taxonomy
74+
{
75+
}
76+
77+
/// <summary>
78+
/// Represents a Genus in a Linnaean taxonomy.
79+
/// </summary>
80+
public sealed class Genus : Taxonomy
81+
{
82+
}
83+
84+
/// <summary>
85+
/// Represents an Order in a Linnaean taxonomy.
86+
/// </summary>
87+
public sealed class Order : Taxonomy
88+
{
89+
}
90+
91+
/// <summary>
92+
/// Represents a Phylum in a Linnaean taxonomy.
93+
/// </summary>
94+
public sealed class Phylum : Taxonomy
95+
{
96+
}
97+
98+
/// <summary>
99+
/// Represents a Species in a Linnaean taxonomy.
100+
/// </summary>
101+
public sealed class Species : Taxonomy
102+
{
103+
}
104+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5+
<ProductVersion>9.0.30729</ProductVersion>
6+
<SchemaVersion>2.0</SchemaVersion>
7+
<ProjectGuid>{FC5D18A1-56FD-4018-B607-79841A473B8D}</ProjectGuid>
8+
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>ExpandTreeViewSilverlight</RootNamespace>
12+
<AssemblyName>ExpandTreeViewSilverlight</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<SilverlightApplication>true</SilverlightApplication>
15+
<SupportedCultures>
16+
</SupportedCultures>
17+
<XapOutputs>true</XapOutputs>
18+
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
19+
<XapFilename>ExpandTreeViewSilverlight.xap</XapFilename>
20+
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
21+
<SilverlightAppEntry>ExpandTreeViewSilverlight.App</SilverlightAppEntry>
22+
<TestPageFileName>TestPage.html</TestPageFileName>
23+
<CreateTestPage>true</CreateTestPage>
24+
<ValidateXaml>true</ValidateXaml>
25+
<ThrowErrorsInValidation>false</ThrowErrorsInValidation>
26+
<FileUpgradeFlags>
27+
</FileUpgradeFlags>
28+
<OldToolsVersion>3.5</OldToolsVersion>
29+
<UpgradeBackupLocation>
30+
</UpgradeBackupLocation>
31+
</PropertyGroup>
32+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
33+
<DebugSymbols>true</DebugSymbols>
34+
<DebugType>full</DebugType>
35+
<Optimize>false</Optimize>
36+
<OutputPath>Bin\Debug</OutputPath>
37+
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
38+
<NoStdLib>true</NoStdLib>
39+
<NoConfig>true</NoConfig>
40+
<ErrorReport>prompt</ErrorReport>
41+
<WarningLevel>4</WarningLevel>
42+
</PropertyGroup>
43+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
44+
<DebugType>pdbonly</DebugType>
45+
<Optimize>true</Optimize>
46+
<OutputPath>Bin\Release</OutputPath>
47+
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
48+
<NoStdLib>true</NoStdLib>
49+
<NoConfig>true</NoConfig>
50+
<ErrorReport>prompt</ErrorReport>
51+
<WarningLevel>4</WarningLevel>
52+
</PropertyGroup>
53+
<ItemGroup>
54+
<Reference Include="Microsoft.Windows.Controls, Version=2.0.21027.1502, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
55+
<SpecificVersion>False</SpecificVersion>
56+
<HintPath>SilverlightToolkit\Microsoft.Windows.Controls.dll</HintPath>
57+
</Reference>
58+
<Reference Include="Microsoft.Windows.Controls.DataVisualization, Version=2.0.21027.1502, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
59+
<SpecificVersion>False</SpecificVersion>
60+
<HintPath>SilverlightToolkit\Microsoft.Windows.Controls.DataVisualization.dll</HintPath>
61+
</Reference>
62+
<Reference Include="Microsoft.Windows.Controls.Input, Version=2.0.21027.1502, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
63+
<SpecificVersion>False</SpecificVersion>
64+
<HintPath>SilverlightToolkit\Microsoft.Windows.Controls.Input.dll</HintPath>
65+
</Reference>
66+
<Reference Include="Microsoft.Windows.Controls.Theming, Version=2.0.21027.1502, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
67+
<SpecificVersion>False</SpecificVersion>
68+
<HintPath>SilverlightToolkit\Microsoft.Windows.Controls.Theming.dll</HintPath>
69+
</Reference>
70+
<Reference Include="System.Windows" />
71+
<Reference Include="mscorlib" />
72+
<Reference Include="system" />
73+
<Reference Include="System.Core" />
74+
<Reference Include="System.Net" />
75+
<Reference Include="System.Xml" />
76+
<Reference Include="System.Windows.Browser" />
77+
</ItemGroup>
78+
<ItemGroup>
79+
<Compile Include="App.xaml.cs">
80+
<DependentUpon>App.xaml</DependentUpon>
81+
</Compile>
82+
<Compile Include="DataSource.cs" />
83+
<Compile Include="Page.xaml.cs">
84+
<DependentUpon>Page.xaml</DependentUpon>
85+
</Compile>
86+
<Compile Include="Properties\AssemblyInfo.cs" />
87+
</ItemGroup>
88+
<ItemGroup>
89+
<ApplicationDefinition Include="App.xaml">
90+
<Generator>MSBuild:Compile</Generator>
91+
<SubType>Designer</SubType>
92+
</ApplicationDefinition>
93+
<Page Include="Page.xaml">
94+
<Generator>MSBuild:Compile</Generator>
95+
<SubType>Designer</SubType>
96+
</Page>
97+
</ItemGroup>
98+
<ItemGroup>
99+
<None Include="Properties\AppManifest.xml" />
100+
</ItemGroup>
101+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" Condition="" />
102+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
103+
Other similar extension points exist, see Microsoft.Common.targets.
104+
<Target Name="BeforeBuild">
105+
</Target>
106+
<Target Name="AfterBuild">
107+
</Target>
108+
-->
109+
<ProjectExtensions>
110+
<VisualStudio>
111+
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
112+
<SilverlightProjectProperties />
113+
</FlavorProperties>
114+
</VisualStudio>
115+
</ProjectExtensions>
116+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<ProjectExtensions>
3+
<VisualStudio>
4+
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}" xmlns="">
5+
<SilverlightProjectProperties>
6+
<StartPageUrl>
7+
</StartPageUrl>
8+
<StartAction>DynamicPage</StartAction>
9+
<AspNetDebugging>True</AspNetDebugging>
10+
<NativeDebugging>False</NativeDebugging>
11+
<SQLDebugging>False</SQLDebugging>
12+
<ExternalProgram>
13+
</ExternalProgram>
14+
<StartExternalURL>
15+
</StartExternalURL>
16+
<StartCmdLineArguments>
17+
</StartCmdLineArguments>
18+
<StartWorkingDirectory>
19+
</StartWorkingDirectory>
20+
<ShowWebRefOnDebugPrompt>True</ShowWebRefOnDebugPrompt>
21+
</SilverlightProjectProperties>
22+
</FlavorProperties>
23+
</VisualStudio>
24+
</ProjectExtensions>
25+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 10.00
3+
# Visual Studio 2008
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExpandTreeViewSilverlight", "ExpandTreeViewSilverlight.csproj", "{FC5D18A1-56FD-4018-B607-79841A473B8D}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Any CPU = Debug|Any CPU
9+
Release|Any CPU = Release|Any CPU
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{FC5D18A1-56FD-4018-B607-79841A473B8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13+
{FC5D18A1-56FD-4018-B607-79841A473B8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{FC5D18A1-56FD-4018-B607-79841A473B8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
15+
{FC5D18A1-56FD-4018-B607-79841A473B8D}.Release|Any CPU.Build.0 = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal
Binary file not shown.

0 commit comments

Comments
 (0)