Skip to content

Commit 98b0474

Browse files
committed
Added 47th post.
1 parent a32b642 commit 98b0474

Some content is hidden

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

54 files changed

+2405
-0
lines changed
Lines changed: 8 additions & 0 deletions
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>
Lines changed: 66 additions & 0 deletions
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+
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
using System;
2+
using System.Net;
3+
using System.Windows;
4+
using System.Windows.Controls;
5+
using System.Windows.Documents;
6+
using System.Windows.Ink;
7+
using System.Windows.Input;
8+
using System.Windows.Media;
9+
using System.Windows.Media.Animation;
10+
using System.Windows.Shapes;
11+
using System.Collections.ObjectModel;
12+
using System.Globalization;
13+
using System.Windows.Markup;
14+
15+
namespace ExpandTreeViewSilverlight
16+
{
17+
/// <summary>
18+
/// Represents an item contained in a level of a Linnaean taxonomy.
19+
/// </summary>
20+
[ContentProperty("Subclasses")]
21+
public abstract class Taxonomy
22+
{
23+
/// <summary>
24+
/// Gets the name of the TaxonomicRank.
25+
/// </summary>
26+
public string Rank
27+
{
28+
get { return GetType().Name; }
29+
}
30+
31+
/// <summary>
32+
/// Gets or sets the classification of the item being ranked.
33+
/// </summary>
34+
public string Classification { get; set; }
35+
36+
/// <summary>
37+
/// Gets the subclasses of of the item being ranked.
38+
/// </summary>
39+
public Collection<Taxonomy> Subclasses { get; private set; }
40+
41+
/// <summary>
42+
/// Initializes a new instance of the TaxonomicItem class.
43+
/// </summary>
44+
protected Taxonomy()
45+
{
46+
Subclasses = new Collection<Taxonomy>();
47+
}
48+
49+
/// <summary>
50+
/// Get a string representation of the TaxonomicItem.
51+
/// </summary>
52+
/// <returns>String representation of the TaxonomicItem.</returns>
53+
public override string ToString()
54+
{
55+
return string.Format(CultureInfo.InvariantCulture, "{0}: {1}", Rank, Classification);
56+
}
57+
}
58+
59+
/// <summary>
60+
/// Represents a Domain in a Linnaean taxonomy.
61+
/// </summary>
62+
public sealed class Domain : Taxonomy
63+
{
64+
}
65+
66+
/// <summary>
67+
/// Represents a Kingdom in a Linnaean taxonomy.
68+
/// </summary>
69+
public sealed class Kingdom : Taxonomy
70+
{
71+
}
72+
73+
/// <summary>
74+
/// Represents a Class in a Linnaean taxonomy.
75+
/// </summary>
76+
public sealed class Class : Taxonomy
77+
{
78+
}
79+
80+
/// <summary>
81+
/// Represents a Family in a Linnaean taxonomy.
82+
/// </summary>
83+
public sealed class Family : Taxonomy
84+
{
85+
}
86+
87+
/// <summary>
88+
/// Represents a Genus in a Linnaean taxonomy.
89+
/// </summary>
90+
public sealed class Genus : Taxonomy
91+
{
92+
}
93+
94+
/// <summary>
95+
/// Represents an Order in a Linnaean taxonomy.
96+
/// </summary>
97+
public sealed class Order : Taxonomy
98+
{
99+
}
100+
101+
/// <summary>
102+
/// Represents a Phylum in a Linnaean taxonomy.
103+
/// </summary>
104+
public sealed class Phylum : Taxonomy
105+
{
106+
}
107+
108+
/// <summary>
109+
/// Represents a Species in a Linnaean taxonomy.
110+
/// </summary>
111+
public sealed class Species : Taxonomy
112+
{
113+
}
114+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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>{AC358F6E-C4E8-4614-A256-E8D07638BC5E}</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+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
28+
<DebugSymbols>true</DebugSymbols>
29+
<DebugType>full</DebugType>
30+
<Optimize>false</Optimize>
31+
<OutputPath>Bin\Debug</OutputPath>
32+
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
33+
<NoStdLib>true</NoStdLib>
34+
<NoConfig>true</NoConfig>
35+
<ErrorReport>prompt</ErrorReport>
36+
<WarningLevel>4</WarningLevel>
37+
</PropertyGroup>
38+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
39+
<DebugType>pdbonly</DebugType>
40+
<Optimize>true</Optimize>
41+
<OutputPath>Bin\Release</OutputPath>
42+
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
43+
<NoStdLib>true</NoStdLib>
44+
<NoConfig>true</NoConfig>
45+
<ErrorReport>prompt</ErrorReport>
46+
<WarningLevel>4</WarningLevel>
47+
</PropertyGroup>
48+
<ItemGroup>
49+
<Reference Include="Microsoft.Windows.Controls, Version=2.0.21027.1502, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
50+
<SpecificVersion>False</SpecificVersion>
51+
<HintPath>SilverlightToolkit\Microsoft.Windows.Controls.dll</HintPath>
52+
</Reference>
53+
<Reference Include="Microsoft.Windows.Controls.DataVisualization, Version=2.0.21027.1502, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
54+
<SpecificVersion>False</SpecificVersion>
55+
<HintPath>SilverlightToolkit\Microsoft.Windows.Controls.DataVisualization.dll</HintPath>
56+
</Reference>
57+
<Reference Include="Microsoft.Windows.Controls.Input, Version=2.0.21027.1502, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
58+
<SpecificVersion>False</SpecificVersion>
59+
<HintPath>SilverlightToolkit\Microsoft.Windows.Controls.Input.dll</HintPath>
60+
</Reference>
61+
<Reference Include="Microsoft.Windows.Controls.Theming, Version=2.0.21027.1502, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
62+
<SpecificVersion>False</SpecificVersion>
63+
<HintPath>SilverlightToolkit\Microsoft.Windows.Controls.Theming.dll</HintPath>
64+
</Reference>
65+
<Reference Include="System.Windows" />
66+
<Reference Include="mscorlib" />
67+
<Reference Include="system" />
68+
<Reference Include="System.Core" />
69+
<Reference Include="System.Net" />
70+
<Reference Include="System.Xml" />
71+
<Reference Include="System.Windows.Browser" />
72+
</ItemGroup>
73+
<ItemGroup>
74+
<Compile Include="App.xaml.cs">
75+
<DependentUpon>App.xaml</DependentUpon>
76+
</Compile>
77+
<Compile Include="DataSource.cs" />
78+
<Compile Include="Page.xaml.cs">
79+
<DependentUpon>Page.xaml</DependentUpon>
80+
</Compile>
81+
<Compile Include="Properties\AssemblyInfo.cs" />
82+
</ItemGroup>
83+
<ItemGroup>
84+
<ApplicationDefinition Include="App.xaml">
85+
<Generator>MSBuild:MarkupCompilePass1</Generator>
86+
<SubType>Designer</SubType>
87+
</ApplicationDefinition>
88+
<Page Include="Page.xaml">
89+
<Generator>MSBuild:MarkupCompilePass1</Generator>
90+
<SubType>Designer</SubType>
91+
</Page>
92+
</ItemGroup>
93+
<ItemGroup>
94+
<None Include="Properties\AppManifest.xml" />
95+
</ItemGroup>
96+
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v2.0\Microsoft.Silverlight.CSharp.targets" />
97+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
98+
Other similar extension points exist, see Microsoft.Common.targets.
99+
<Target Name="BeforeBuild">
100+
</Target>
101+
<Target Name="AfterBuild">
102+
</Target>
103+
-->
104+
<ProjectExtensions>
105+
<VisualStudio>
106+
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
107+
<SilverlightProjectProperties />
108+
</FlavorProperties>
109+
</VisualStudio>
110+
</ProjectExtensions>
111+
</Project>
Lines changed: 25 additions & 0 deletions
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}">
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>
Lines changed: 20 additions & 0 deletions
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", "{AC358F6E-C4E8-4614-A256-E8D07638BC5E}"
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+
{AC358F6E-C4E8-4614-A256-E8D07638BC5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13+
{AC358F6E-C4E8-4614-A256-E8D07638BC5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{AC358F6E-C4E8-4614-A256-E8D07638BC5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
15+
{AC358F6E-C4E8-4614-A256-E8D07638BC5E}.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)