Skip to content

Commit

Permalink
chore: Update xsd samples and workspace structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
ext-michal.rogalinski committed Jan 7, 2019
1 parent d33b1dd commit 6659926
Show file tree
Hide file tree
Showing 5 changed files with 1,909 additions and 38 deletions.
11 changes: 3 additions & 8 deletions test/Avalonia/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"name": "Generate Avalonia sample Xsd",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
Expand All @@ -17,11 +17,6 @@
"console": "externalTerminal",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
} ]
}
]
}
11 changes: 3 additions & 8 deletions test/Wpf/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"name": "Generate Wpf sample Xsd",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
Expand All @@ -17,11 +17,6 @@
"console": "externalTerminal",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
} ]
}
]
}
10 changes: 5 additions & 5 deletions test/Wpf/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using System.Globalization;

namespace Wpf {
public static class Program
public static class Program
{
private static XNamespace ns = "http://www.w3.org/2001/XMLSchema";

Expand All @@ -29,13 +29,13 @@ public static void Main(string[] args)
{
Func<string, bool> isAlphanumeric = str => !alphanumeric.IsMatch(str);

var assembly = Assembly.GetAssembly(typeof(Control));
var assembly = Assembly.GetAssembly(typeof(FrameworkElement));
var controlsWithAttributes = assembly.GetExportedTypes()
.Where(t => !t.IsAbstract && typeof(Control).IsAssignableFrom(t) && isAlphanumeric(t.Name))
.Where(t => !t.IsAbstract && typeof(FrameworkElement).IsAssignableFrom(t) && isAlphanumeric(t.Name))
.ToDictionary(t => t.Name, t => t.GetProperties().Where(p => isAlphanumeric(p.Name)).Select(p => p.Name).Distinct().ToList());

var baseControl = controlsWithAttributes.First(c => c.Key == typeof(Control).Name);
controlsWithAttributes.Remove(typeof(Control).Name);
var baseControl = controlsWithAttributes.First(c => c.Key == typeof(FrameworkElement).Name);
controlsWithAttributes.Remove(typeof(FrameworkElement).Name);

foreach (var ca in controlsWithAttributes)
{
Expand Down
Loading

0 comments on commit 6659926

Please sign in to comment.