Skip to content

Commit a01ada0

Browse files
hpsinWilliamsJason
authored andcommitted
v0.9.1 Release - Async Breaking Change and Dump Collection (#195)
* DeviceLab sample * This is what I showed to Dave * Committing so that I can change machines and not loose my work * Added a bunch of finishing touches * Latest polish * Added a nifty CommandSequence class * Implemented a nifty CommandSequence class and then used it for the DevicePortalCommand model * Code cleanup + style cop. Checking in for demo * Finished satisfyint StyleCop * Committing before merging changes from upstream * Integrated the new DeviceSignIn view. Fixed the timing issue in the reestablish connection retry loop. Made rename more robust. Stronger check for duplicates using the cannonical IP address * Renamed DeviceLab to SampleDeviceCollection * Added finishing touches to the code. Getting it ready for a pull request * Breaking Change: Updating async methods to follow C# async naming conventions (#188) And updating version number. * Update calls into the wrapper to use the latest async naming convention * Not tracking sync.cmd * Ended up with a stray orig file. Deleting * Change array return types to Lists for #189 (#191) * App, process, and crash dump collection APIs (#193) * Add usermode crash dump APIs * Additional fixes to DumpCollection * Add kernel, live, and app dump APIs. * StyleCop pass
1 parent 44ba979 commit a01ada0

File tree

126 files changed

+5159
-542
lines changed

Some content is hidden

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

126 files changed

+5159
-542
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*.user
77
*.userosscache
88
*.sln.docstates
9+
sync.cmd
910

1011
# User-specific files (MonoDevelop/Xamarin Studio)
1112
*.userprefs
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="SampleDeviceCollection.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:SampleDeviceCollection"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
<ResourceDictionary Source="Themes\CustomStyles.xaml" />
8+
</Application.Resources>
9+
</Application>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//----------------------------------------------------------------------------------------------
2+
// <copyright file="App.xaml.cs" company="Microsoft Corporation">
3+
// Licensed under the MIT License. See LICENSE.TXT in the project root license information.
4+
// </copyright>
5+
//----------------------------------------------------------------------------------------------
6+
using System.Windows;
7+
8+
namespace SampleDeviceCollection
9+
{
10+
/// <summary>
11+
/// Interaction logic for App.xaml
12+
/// </summary>
13+
public partial class App : Application
14+
{
15+
}
16+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
//----------------------------------------------------------------------------------------------
2+
// <copyright file="BooleanConverter.cs" company="Microsoft Corporation">
3+
// Licensed under the MIT License. See LICENSE.TXT in the project root license information.
4+
// </copyright>
5+
//----------------------------------------------------------------------------------------------
6+
using System;
7+
using System.Collections.Generic;
8+
using System.Globalization;
9+
using System.Windows;
10+
using System.Windows.Data;
11+
12+
namespace SampleDeviceCollection
13+
{
14+
//-------------------------------------------------------------------
15+
// Boolean Converter
16+
//-------------------------------------------------------------------
17+
#region Boolean Converter
18+
/// <summary>
19+
/// Template allows for easy creation of a value converter for bools
20+
/// </summary>
21+
/// <typeparam name="T">Type to convert back and forth to boolean</typeparam>
22+
/// <remarks>
23+
/// See BooleanToVisibilityConverter and BooleanToBrushConverter (below) and usage in Generic.xaml
24+
/// </remarks>
25+
public class BooleanConverter<T> : IValueConverter
26+
{
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="BooleanConverter{T}" /> class.
29+
/// </summary>
30+
/// <param name="trueValue">The value of type T that represents true</param>
31+
/// <param name="falseValue">The value of type T that represents false</param>
32+
public BooleanConverter(T trueValue, T falseValue)
33+
{
34+
this.True = trueValue;
35+
this.False = falseValue;
36+
}
37+
38+
/// <summary>
39+
/// Gets or sets the value that represents true
40+
/// </summary>
41+
public T True { get; set; }
42+
43+
/// <summary>
44+
/// Gets or sets the value that represetns false
45+
/// </summary>
46+
public T False { get; set; }
47+
48+
/// <summary>
49+
/// Convert an object of type T to boolean
50+
/// </summary>
51+
/// <param name="value">Object of type T to convert</param>
52+
/// <param name="targetType">The parameter is not used.</param>
53+
/// <param name="parameter">The parameter is not used.</param>
54+
/// <param name="culture">The parameter is not used.</param>
55+
/// <returns>Object of boolean value</returns>
56+
public virtual object Convert(object value, Type targetType, object parameter, CultureInfo culture)
57+
{
58+
return value is bool && ((bool)value) ? this.True : this.False;
59+
}
60+
61+
/// <summary>
62+
/// Convert a boolean value to an object of type T
63+
/// </summary>
64+
/// <param name="value">The boolean value to convert</param>
65+
/// <param name="targetType">The parameter is not used.</param>
66+
/// <param name="parameter">The parameter is not used.</param>
67+
/// <param name="culture">The parameter is not used.</param>
68+
/// <returns>Object of type T</returns>
69+
public virtual object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
70+
{
71+
return value is T && EqualityComparer<T>.Default.Equals((T)value, this.True);
72+
}
73+
}
74+
75+
/// <summary>
76+
/// Converter between a boolean and visibility value
77+
/// </summary>
78+
[type: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Small classes are all instances of the same generic and are better organized in a single file.")]
79+
public sealed class BooleanToVisibilityConverter : BooleanConverter<Visibility>
80+
{
81+
/// <summary>
82+
/// Initializes a new instance of the <see cref="BooleanToVisibilityConverter" /> class.
83+
/// </summary>
84+
public BooleanToVisibilityConverter() :
85+
base(Visibility.Visible, Visibility.Hidden)
86+
{
87+
}
88+
}
89+
90+
/// <summary>
91+
/// Converter between a boolean and either "http" or "https"
92+
/// </summary>
93+
[type: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Small classes are all instances of the same generic and are better organized in a single file.")]
94+
public sealed class BooleanToHttpsConverter : BooleanConverter<string>
95+
{
96+
/// <summary>
97+
/// Initializes a new instance of the <see cref="BooleanToHttpsConverter" /> class.
98+
/// </summary>
99+
public BooleanToHttpsConverter() :
100+
base("https", "http")
101+
{
102+
}
103+
}
104+
#endregion // Boolean Converter
105+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//----------------------------------------------------------------------------------------------
2+
// <copyright file="AutoScrollTextBox.cs" company="Microsoft Corporation">
3+
// Licensed under the MIT License. See LICENSE.TXT in the project root license information.
4+
// </copyright>
5+
//----------------------------------------------------------------------------------------------
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
9+
namespace SampleDeviceCollection
10+
{
11+
/// <summary>
12+
/// A TextBox derrivative that automatically scrolls to end whenever new text is added.
13+
/// This is used for presenting scrolling output spew.
14+
/// </summary>
15+
public class AutoScrollTextBox : TextBox
16+
{
17+
/// <summary>
18+
/// Initializes static members of the <see cref="AutoScrollTextBox" /> class.
19+
/// </summary>
20+
static AutoScrollTextBox()
21+
{
22+
DefaultStyleKeyProperty.OverrideMetadata(typeof(AutoScrollTextBox), new FrameworkPropertyMetadata(typeof(AutoScrollTextBox)));
23+
}
24+
25+
/// <summary>
26+
/// Override OnTextChanged to automatically scroll to the end
27+
/// </summary>
28+
/// <param name="e">The arguments associated with this event</param>
29+
protected override void OnTextChanged(TextChangedEventArgs e)
30+
{
31+
base.OnTextChanged(e);
32+
this.CaretIndex = Text.Length;
33+
this.ScrollToEnd();
34+
}
35+
}
36+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<UserControl x:Class="SampleDeviceCollection.BindablePassword"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
mc:Ignorable="d"
7+
d:DesignHeight="23" d:DesignWidth="200">
8+
<Grid>
9+
<PasswordBox Name="PasswordBox" PasswordChanged="PasswordBox_PasswordChanged"/>
10+
</Grid>
11+
</UserControl>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//----------------------------------------------------------------------------------------------
2+
// <copyright file="BindablePassword.xaml.cs" company="Microsoft Corporation">
3+
// Licensed under the MIT License. See LICENSE.TXT in the project root license information.
4+
// </copyright>
5+
//----------------------------------------------------------------------------------------------
6+
using System.Security;
7+
using System.Windows;
8+
using System.Windows.Controls;
9+
10+
namespace SampleDeviceCollection
11+
{
12+
/// <summary>
13+
/// Interaction logic for BindablePassword.xaml
14+
/// </summary>
15+
public partial class BindablePassword : UserControl
16+
{
17+
//-------------------------------------------------------------------
18+
// Constructors
19+
//-------------------------------------------------------------------
20+
#region Constructors
21+
/// <summary>
22+
/// Initializes a new instance of the <see cref="BindablePassword" /> class.
23+
/// </summary>
24+
public BindablePassword()
25+
{
26+
this.InitializeComponent();
27+
}
28+
#endregion // Constructors
29+
30+
//-------------------------------------------------------------------
31+
// Dependency Properties
32+
//-------------------------------------------------------------------
33+
#region Dependency Properties
34+
#region Password Dependency Property
35+
/// <summary>
36+
/// Gets or sets the Password dependency property
37+
/// </summary>
38+
public SecureString Password
39+
{
40+
get
41+
{
42+
return (SecureString)GetValue(PasswordProperty);
43+
}
44+
45+
set
46+
{
47+
this.SetValue(PasswordProperty, value);
48+
}
49+
}
50+
51+
/// <summary>
52+
/// Password Dependeny Property static association
53+
/// </summary>
54+
public static readonly DependencyProperty PasswordProperty =
55+
DependencyProperty.Register(
56+
"Password",
57+
typeof(SecureString),
58+
typeof(BindablePassword),
59+
new PropertyMetadata(default(SecureString)));
60+
61+
/// <summary>
62+
/// Forwards change events to the password box's secure string to the Password dependency property
63+
/// </summary>
64+
/// <param name="sender">object that originated the event</param>
65+
/// <param name="e">Parameters for the event</param>
66+
private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
67+
{
68+
this.Password = ((PasswordBox)sender).SecurePassword;
69+
}
70+
#endregion // Password Dependency Property
71+
#endregion // Dependency Properties
72+
}
73+
}

0 commit comments

Comments
 (0)