Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
262d065
DeviceLab sample
GregPettyjohn Aug 12, 2016
94cca6f
This is what I showed to Dave
GregPettyjohn Aug 12, 2016
46cabd4
Committing so that I can change machines and not loose my work
GregPettyjohn Aug 22, 2016
aaa9c91
Added a bunch of finishing touches
GregPettyjohn Aug 24, 2016
d543959
Merge remote-tracking branch 'upstream/master'
GregPettyjohn Aug 24, 2016
cfd71a8
Latest polish
GregPettyjohn Aug 29, 2016
078c278
Added a nifty CommandSequence class
GregPettyjohn Aug 29, 2016
7a1388e
Implemented a nifty CommandSequence class and then used it for the De…
GregPettyjohn Aug 30, 2016
b8e1484
Merge remote-tracking branch 'upstream/master'
GregPettyjohn Aug 30, 2016
66cd7f7
Code cleanup + style cop. Checking in for demo
GregPettyjohn Aug 30, 2016
1239e90
Finished satisfyint StyleCop
GregPettyjohn Sep 1, 2016
331267b
Syncing with latest from the main fork
GregPettyjohn Sep 1, 2016
81712df
Merge remote-tracking branch 'upstream/master'
GregPettyjohn Sep 7, 2016
99007d8
Committing before merging changes from upstream
GregPettyjohn Sep 12, 2016
6a8a32b
Merge remote-tracking branch 'upstream/master'
GregPettyjohn Sep 12, 2016
ab8eed0
Integrated the new DeviceSignIn view. Fixed the timing issue in the r…
GregPettyjohn Sep 21, 2016
da099b2
Merge remote-tracking branch 'upstream/master'
GregPettyjohn Sep 21, 2016
a49bab9
Renamed DeviceLab to SampleDeviceCollection
GregPettyjohn Sep 23, 2016
377b3c2
Added finishing touches to the code. Getting it ready for a pull request
GregPettyjohn Sep 28, 2016
cfa9144
Breaking Change: Updating async methods to follow C# async naming con…
hpsin Oct 11, 2016
7e28aae
Merge the latest from the upstream repo
GregPettyjohn Oct 12, 2016
c8bef65
Update calls into the wrapper to use the latest async naming convention
GregPettyjohn Oct 12, 2016
870c303
Not tracking sync.cmd
GregPettyjohn Oct 12, 2016
6991238
Ended up with a stray orig file. Deleting
GregPettyjohn Oct 12, 2016
d1941d9
Change array return types to Lists for #189 (#191)
hpsin Oct 15, 2016
175a541
App, process, and crash dump collection APIs (#193)
hpsin Oct 17, 2016
bb4bc56
Merge pull request #192 from GregPettyjohn/master
Oct 17, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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