Skip to content

Commit

Permalink
v0.9.1 Release - Async Breaking Change and Dump Collection (#195)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
hpsin authored and WilliamsJason committed Oct 18, 2016
1 parent 44ba979 commit a01ada0
Show file tree
Hide file tree
Showing 126 changed files with 5,159 additions and 542 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.user
*.userosscache
*.sln.docstates
sync.cmd

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
6 changes: 6 additions & 0 deletions Samples/SampleDeviceCollection/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
9 changes: 9 additions & 0 deletions Samples/SampleDeviceCollection/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="SampleDeviceCollection.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SampleDeviceCollection"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary Source="Themes\CustomStyles.xaml" />
</Application.Resources>
</Application>
16 changes: 16 additions & 0 deletions Samples/SampleDeviceCollection/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//----------------------------------------------------------------------------------------------
// <copyright file="App.xaml.cs" company="Microsoft Corporation">
// Licensed under the MIT License. See LICENSE.TXT in the project root license information.
// </copyright>
//----------------------------------------------------------------------------------------------
using System.Windows;

namespace SampleDeviceCollection
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
105 changes: 105 additions & 0 deletions Samples/SampleDeviceCollection/BooleanConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
//----------------------------------------------------------------------------------------------
// <copyright file="BooleanConverter.cs" company="Microsoft Corporation">
// Licensed under the MIT License. See LICENSE.TXT in the project root license information.
// </copyright>
//----------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace SampleDeviceCollection
{
//-------------------------------------------------------------------
// Boolean Converter
//-------------------------------------------------------------------
#region Boolean Converter
/// <summary>
/// Template allows for easy creation of a value converter for bools
/// </summary>
/// <typeparam name="T">Type to convert back and forth to boolean</typeparam>
/// <remarks>
/// See BooleanToVisibilityConverter and BooleanToBrushConverter (below) and usage in Generic.xaml
/// </remarks>
public class BooleanConverter<T> : IValueConverter
{
/// <summary>
/// Initializes a new instance of the <see cref="BooleanConverter{T}" /> class.
/// </summary>
/// <param name="trueValue">The value of type T that represents true</param>
/// <param name="falseValue">The value of type T that represents false</param>
public BooleanConverter(T trueValue, T falseValue)
{
this.True = trueValue;
this.False = falseValue;
}

/// <summary>
/// Gets or sets the value that represents true
/// </summary>
public T True { get; set; }

/// <summary>
/// Gets or sets the value that represetns false
/// </summary>
public T False { get; set; }

/// <summary>
/// Convert an object of type T to boolean
/// </summary>
/// <param name="value">Object of type T to convert</param>
/// <param name="targetType">The parameter is not used.</param>
/// <param name="parameter">The parameter is not used.</param>
/// <param name="culture">The parameter is not used.</param>
/// <returns>Object of boolean value</returns>
public virtual object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value is bool && ((bool)value) ? this.True : this.False;
}

/// <summary>
/// Convert a boolean value to an object of type T
/// </summary>
/// <param name="value">The boolean value to convert</param>
/// <param name="targetType">The parameter is not used.</param>
/// <param name="parameter">The parameter is not used.</param>
/// <param name="culture">The parameter is not used.</param>
/// <returns>Object of type T</returns>
public virtual object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return value is T && EqualityComparer<T>.Default.Equals((T)value, this.True);
}
}

/// <summary>
/// Converter between a boolean and visibility value
/// </summary>
[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.")]
public sealed class BooleanToVisibilityConverter : BooleanConverter<Visibility>
{
/// <summary>
/// Initializes a new instance of the <see cref="BooleanToVisibilityConverter" /> class.
/// </summary>
public BooleanToVisibilityConverter() :
base(Visibility.Visible, Visibility.Hidden)
{
}
}

/// <summary>
/// Converter between a boolean and either "http" or "https"
/// </summary>
[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.")]
public sealed class BooleanToHttpsConverter : BooleanConverter<string>
{
/// <summary>
/// Initializes a new instance of the <see cref="BooleanToHttpsConverter" /> class.
/// </summary>
public BooleanToHttpsConverter() :
base("https", "http")
{
}
}
#endregion // Boolean Converter
}
36 changes: 36 additions & 0 deletions Samples/SampleDeviceCollection/Controls/AutoScrollTextBox.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//----------------------------------------------------------------------------------------------
// <copyright file="AutoScrollTextBox.cs" company="Microsoft Corporation">
// Licensed under the MIT License. See LICENSE.TXT in the project root license information.
// </copyright>
//----------------------------------------------------------------------------------------------
using System.Windows;
using System.Windows.Controls;

namespace SampleDeviceCollection
{
/// <summary>
/// A TextBox derrivative that automatically scrolls to end whenever new text is added.
/// This is used for presenting scrolling output spew.
/// </summary>
public class AutoScrollTextBox : TextBox
{
/// <summary>
/// Initializes static members of the <see cref="AutoScrollTextBox" /> class.
/// </summary>
static AutoScrollTextBox()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(AutoScrollTextBox), new FrameworkPropertyMetadata(typeof(AutoScrollTextBox)));
}

/// <summary>
/// Override OnTextChanged to automatically scroll to the end
/// </summary>
/// <param name="e">The arguments associated with this event</param>
protected override void OnTextChanged(TextChangedEventArgs e)
{
base.OnTextChanged(e);
this.CaretIndex = Text.Length;
this.ScrollToEnd();
}
}
}
11 changes: 11 additions & 0 deletions Samples/SampleDeviceCollection/Controls/BindablePassword.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<UserControl x:Class="SampleDeviceCollection.BindablePassword"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="23" d:DesignWidth="200">
<Grid>
<PasswordBox Name="PasswordBox" PasswordChanged="PasswordBox_PasswordChanged"/>
</Grid>
</UserControl>
73 changes: 73 additions & 0 deletions Samples/SampleDeviceCollection/Controls/BindablePassword.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//----------------------------------------------------------------------------------------------
// <copyright file="BindablePassword.xaml.cs" company="Microsoft Corporation">
// Licensed under the MIT License. See LICENSE.TXT in the project root license information.
// </copyright>
//----------------------------------------------------------------------------------------------
using System.Security;
using System.Windows;
using System.Windows.Controls;

namespace SampleDeviceCollection
{
/// <summary>
/// Interaction logic for BindablePassword.xaml
/// </summary>
public partial class BindablePassword : UserControl
{
//-------------------------------------------------------------------
// Constructors
//-------------------------------------------------------------------
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="BindablePassword" /> class.
/// </summary>
public BindablePassword()
{
this.InitializeComponent();
}
#endregion // Constructors

//-------------------------------------------------------------------
// Dependency Properties
//-------------------------------------------------------------------
#region Dependency Properties
#region Password Dependency Property
/// <summary>
/// Gets or sets the Password dependency property
/// </summary>
public SecureString Password
{
get
{
return (SecureString)GetValue(PasswordProperty);
}

set
{
this.SetValue(PasswordProperty, value);
}
}

/// <summary>
/// Password Dependeny Property static association
/// </summary>
public static readonly DependencyProperty PasswordProperty =
DependencyProperty.Register(
"Password",
typeof(SecureString),
typeof(BindablePassword),
new PropertyMetadata(default(SecureString)));

/// <summary>
/// Forwards change events to the password box's secure string to the Password dependency property
/// </summary>
/// <param name="sender">object that originated the event</param>
/// <param name="e">Parameters for the event</param>
private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
{
this.Password = ((PasswordBox)sender).SecurePassword;
}
#endregion // Password Dependency Property
#endregion // Dependency Properties
}
}
Loading

0 comments on commit a01ada0

Please sign in to comment.