diff --git a/77-CaptureWatcher/CaptureWatcher.cs b/77-CaptureWatcher/CaptureWatcher.cs new file mode 100644 index 0000000..269ce19 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcher.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Windows.UI; +using Windows.UI.Text; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; + +namespace ZagStudio.Helpers +{ + public class CaptureWatcher + { + #region --- constants --- + + private const double margin = 2; + private const double borderThickness = 2; + private const double fontSize = 13; + private static readonly Thickness padding = new Thickness(10, 6, 10, 4); + private static readonly Color backgroundColor = Colors.White; + private static readonly Color borderColor = Colors.Black; + private static readonly Color foregroundColor = Colors.Black; + private static readonly TimeSpan updateInterval = TimeSpan.FromSeconds(0.25); + + #endregion + + #region --- fields --- + + private static CaptureWatcher instance; + + private TextBlock textBlock; + private Popup popup; + private DispatcherTimer timer; + + #endregion + + #region --- constructor --- + + private CaptureWatcher() + { + this.textBlock = new TextBlock() + { + FontSize = fontSize, + FontWeight = FontWeights.SemiLight, + Foreground = new SolidColorBrush(foregroundColor) + }; + + Border border = new Border + { + Child = textBlock, + Background = new SolidColorBrush(backgroundColor), + BorderBrush = new SolidColorBrush(borderColor), + BorderThickness = new Thickness(borderThickness), + Padding = padding + }; + + this.popup = new Popup + { + Child = border, + HorizontalOffset = margin, + VerticalOffset = margin, + IsOpen = true + }; + + this.timer = new DispatcherTimer + { + Interval = updateInterval + }; + this.timer.Tick += this.Timer_Tick; + this.timer.Start(); + } + + #endregion + + #region --- public methods --- + + public static void Start() + { + instance = new CaptureWatcher(); + } + + public static void Stop() + { + if (instance != null) + { + instance.timer.Stop(); + instance.popup.IsOpen = false; + instance = null; + } + } + + #endregion + + #region --- private methods --- + + private void Timer_Tick(object sender, object e) + { + StringBuilder builder = new StringBuilder(); + foreach (UIElement element in Window.Current.Content.DescendantsAndSelf()) + { + IReadOnlyList pointerCaptures = element.PointerCaptures; + if (pointerCaptures != null && pointerCaptures.Count > 0) + { + builder.Append(element.GetType().Name); + builder.Append(GetName(element)); + builder.AppendLine(GetContent(element)); + + foreach (Pointer pointer in pointerCaptures) + { + builder.Append(" "); + builder.Append(pointer.PointerDeviceType.ToString()); + builder.Append(" ("); + builder.Append(pointer.PointerId); + builder.AppendLine(pointer.IsInContact ? ") in contact" : + (pointer.IsInRange ? ") in range" : ")")); + } + } + } + if (builder.Length > 0) + { + this.textBlock.Text = builder.ToString().Trim(); + } + else + { + this.textBlock.Text = "no captures"; + } + } + + private static string GetName(object focusedElement) + { + string name = String.Empty; + FrameworkElement frameworkElement = focusedElement as FrameworkElement; + if (frameworkElement != null) + { + name = frameworkElement.Name; + } + + return String.IsNullOrEmpty(name) ? String.Empty : " (" + name + ")"; + } + + private static string GetContent(object focusedElement) + { + string content = String.Empty; + ContentControl contentControl = focusedElement as ContentControl; + if (contentControl != null && contentControl.Content != null) + { + TextBlock textBlock = contentControl.Content as TextBlock; + if (textBlock != null) + { + content = textBlock.Text; + } + else + { + content = contentControl.Content.ToString(); + } + } + + return String.IsNullOrEmpty(content) ? String.Empty : " [" + content + "]"; + } + + #endregion --- private methods --- + } +} diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample.sln b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample.sln new file mode 100644 index 0000000..32bbd56 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptureWatcherSample", "CaptureWatcherSample\CaptureWatcherSample.csproj", "{3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|ARM.ActiveCfg = Debug|ARM + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|ARM.Build.0 = Debug|ARM + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|ARM.Deploy.0 = Debug|ARM + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|x64.ActiveCfg = Debug|x64 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|x64.Build.0 = Debug|x64 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|x64.Deploy.0 = Debug|x64 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|x86.ActiveCfg = Debug|x86 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|x86.Build.0 = Debug|x86 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Debug|x86.Deploy.0 = Debug|x86 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|Any CPU.Build.0 = Release|Any CPU + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|Any CPU.Deploy.0 = Release|Any CPU + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|ARM.ActiveCfg = Release|ARM + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|ARM.Build.0 = Release|ARM + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|ARM.Deploy.0 = Release|ARM + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|x64.ActiveCfg = Release|x64 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|x64.Build.0 = Release|x64 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|x64.Deploy.0 = Release|x64 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|x86.ActiveCfg = Release|x86 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|x86.Build.0 = Release|x86 + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample.v11.suo b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample.v11.suo new file mode 100644 index 0000000..7bf424f Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample.v11.suo differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/App.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/App.xaml new file mode 100644 index 0000000..5208e21 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/App.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/App.xaml.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/App.xaml.cs new file mode 100644 index 0000000..145eb81 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/App.xaml.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +namespace CaptureWatcherSample +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + sealed partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + this.Suspending += OnSuspending; + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used when the application is launched to open a specific file, to display + /// search results, and so forth. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs args) + { + Frame rootFrame = Window.Current.Content as Frame; + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == null) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) + { + //TODO: Load state from previously suspended application + } + + // Place the frame in the current Window + Window.Current.Content = rootFrame; + } + + if (rootFrame.Content == null) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + if (!rootFrame.Navigate(typeof(MainPage), args.Arguments)) + { + throw new Exception("Failed to create initial page"); + } + } + // Ensure the current window is active + Window.Current.Activate(); + ZagStudio.Helpers.CaptureWatcher.Start(); + } + + /// + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// + /// The source of the suspend request. + /// Details about the suspend request. + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + //TODO: Save application state and stop any background activity + deferral.Complete(); + } + } +} diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/Logo.png b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/Logo.png new file mode 100644 index 0000000..e26771c Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/Logo.png differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/SmallLogo.png b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/SmallLogo.png new file mode 100644 index 0000000..1eb0d9d Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/SmallLogo.png differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/SplashScreen.png b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/SplashScreen.png new file mode 100644 index 0000000..c951e03 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/SplashScreen.png differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/StoreLogo.png b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/StoreLogo.png new file mode 100644 index 0000000..dcb6727 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Assets/StoreLogo.png differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcher.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcher.cs new file mode 100644 index 0000000..269ce19 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcher.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Windows.UI; +using Windows.UI.Text; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; + +namespace ZagStudio.Helpers +{ + public class CaptureWatcher + { + #region --- constants --- + + private const double margin = 2; + private const double borderThickness = 2; + private const double fontSize = 13; + private static readonly Thickness padding = new Thickness(10, 6, 10, 4); + private static readonly Color backgroundColor = Colors.White; + private static readonly Color borderColor = Colors.Black; + private static readonly Color foregroundColor = Colors.Black; + private static readonly TimeSpan updateInterval = TimeSpan.FromSeconds(0.25); + + #endregion + + #region --- fields --- + + private static CaptureWatcher instance; + + private TextBlock textBlock; + private Popup popup; + private DispatcherTimer timer; + + #endregion + + #region --- constructor --- + + private CaptureWatcher() + { + this.textBlock = new TextBlock() + { + FontSize = fontSize, + FontWeight = FontWeights.SemiLight, + Foreground = new SolidColorBrush(foregroundColor) + }; + + Border border = new Border + { + Child = textBlock, + Background = new SolidColorBrush(backgroundColor), + BorderBrush = new SolidColorBrush(borderColor), + BorderThickness = new Thickness(borderThickness), + Padding = padding + }; + + this.popup = new Popup + { + Child = border, + HorizontalOffset = margin, + VerticalOffset = margin, + IsOpen = true + }; + + this.timer = new DispatcherTimer + { + Interval = updateInterval + }; + this.timer.Tick += this.Timer_Tick; + this.timer.Start(); + } + + #endregion + + #region --- public methods --- + + public static void Start() + { + instance = new CaptureWatcher(); + } + + public static void Stop() + { + if (instance != null) + { + instance.timer.Stop(); + instance.popup.IsOpen = false; + instance = null; + } + } + + #endregion + + #region --- private methods --- + + private void Timer_Tick(object sender, object e) + { + StringBuilder builder = new StringBuilder(); + foreach (UIElement element in Window.Current.Content.DescendantsAndSelf()) + { + IReadOnlyList pointerCaptures = element.PointerCaptures; + if (pointerCaptures != null && pointerCaptures.Count > 0) + { + builder.Append(element.GetType().Name); + builder.Append(GetName(element)); + builder.AppendLine(GetContent(element)); + + foreach (Pointer pointer in pointerCaptures) + { + builder.Append(" "); + builder.Append(pointer.PointerDeviceType.ToString()); + builder.Append(" ("); + builder.Append(pointer.PointerId); + builder.AppendLine(pointer.IsInContact ? ") in contact" : + (pointer.IsInRange ? ") in range" : ")")); + } + } + } + if (builder.Length > 0) + { + this.textBlock.Text = builder.ToString().Trim(); + } + else + { + this.textBlock.Text = "no captures"; + } + } + + private static string GetName(object focusedElement) + { + string name = String.Empty; + FrameworkElement frameworkElement = focusedElement as FrameworkElement; + if (frameworkElement != null) + { + name = frameworkElement.Name; + } + + return String.IsNullOrEmpty(name) ? String.Empty : " (" + name + ")"; + } + + private static string GetContent(object focusedElement) + { + string content = String.Empty; + ContentControl contentControl = focusedElement as ContentControl; + if (contentControl != null && contentControl.Content != null) + { + TextBlock textBlock = contentControl.Content as TextBlock; + if (textBlock != null) + { + content = textBlock.Text; + } + else + { + content = contentControl.Content.ToString(); + } + } + + return String.IsNullOrEmpty(content) ? String.Empty : " [" + content + "]"; + } + + #endregion --- private methods --- + } +} diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcherSample.csproj b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcherSample.csproj new file mode 100644 index 0000000..2dc4a36 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcherSample.csproj @@ -0,0 +1,153 @@ + + + + + Debug + AnyCPU + {3A050AFF-6785-4C6C-83ED-1DCB52A22DFD} + AppContainerExe + Properties + CaptureWatcherSample + CaptureWatcherSample + en-US + 512 + {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + CaptureWatcherSample_TemporaryKey.pfx + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE;NETFX_CORE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE;NETFX_CORE + prompt + 4 + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + ARM + false + prompt + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + ARM + false + prompt + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x64 + false + prompt + true + + + bin\x64\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x64 + false + prompt + true + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x86 + false + prompt + true + + + bin\x86\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x86 + false + prompt + true + + + + + + + App.xaml + + + + MainPage.xaml + + + + + + + Designer + + + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + 11.0 + + + + \ No newline at end of file diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcherSample.csproj.user b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcherSample.csproj.user new file mode 100644 index 0000000..f41c6dc --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcherSample.csproj.user @@ -0,0 +1,9 @@ + + + + True + surface + True + false + + \ No newline at end of file diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcherSample_TemporaryKey.pfx b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcherSample_TemporaryKey.pfx new file mode 100644 index 0000000..89dcd45 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/CaptureWatcherSample_TemporaryKey.pfx differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Common/StandardStyles.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Common/StandardStyles.xaml new file mode 100644 index 0000000..85f4ed6 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Common/StandardStyles.xaml @@ -0,0 +1,1829 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mouse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/MainPage.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/MainPage.xaml new file mode 100644 index 0000000..bdee12c --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/MainPage.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/MainPage.xaml.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/MainPage.xaml.cs new file mode 100644 index 0000000..9e049f4 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/MainPage.xaml.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; +using Windows.UI.Xaml.Shapes; + +namespace CaptureWatcherSample +{ + public sealed partial class MainPage : Page + { + private const int size = 100; + + private Color[] colors = + { + Colors.Red, + Colors.Orange, + Colors.Yellow, + Colors.Green, + Colors.Aqua, + Colors.Blue, + Colors.Violet + }; + private Dictionary ellipses = + new Dictionary(); + + public MainPage() + { + this.InitializeComponent(); + } + + private void Canvas_PointerPressed(object sender, PointerRoutedEventArgs e) + { + if (this.canvas.CapturePointer(e.Pointer)) + { + uint id = e.Pointer.PointerId; + Ellipse ellipse = this.GetEllipse(id); + if (ellipse == null) + { + ellipse = new Ellipse + { + Width = size, + Height = size, + Fill = new SolidColorBrush(this.colors[id % this.colors.Length]) + }; + this.ellipses[id] = ellipse; + } + + Point position = e.GetCurrentPoint(this.canvas).Position; + Canvas.SetLeft(ellipse, position.X - size / 2); + Canvas.SetTop(ellipse, position.Y - size / 2); + this.canvas.Children.Add(ellipse); + } + } + + private void Canvas_PointerMoved(object sender, PointerRoutedEventArgs e) + { + uint id = e.Pointer.PointerId; + Ellipse ellipse = this.GetEllipse(id); + if (ellipse != null) + { + Point position = e.GetCurrentPoint(this.canvas).Position; + Canvas.SetLeft(ellipse, position.X - size / 2); + Canvas.SetTop(ellipse, position.Y - size / 2); + } + } + + private void Canvas_PointerReleased(object sender, PointerRoutedEventArgs e) + { + this.canvas.ReleasePointerCapture(e.Pointer); + } + + private void Canvas_PointerCaptureLost(object sender, PointerRoutedEventArgs e) + { + uint id = e.Pointer.PointerId; + Ellipse ellipse = this.GetEllipse(id); + if (ellipse != null) + { + this.canvas.Children.Remove(ellipse); + this.ellipses.Remove(id); + } + } + + private Ellipse GetEllipse(uint pointerId) + { + Ellipse ellipse = null; + this.ellipses.TryGetValue(pointerId, out ellipse); + return ellipse; + } + } +} diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Package.appxmanifest b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Package.appxmanifest new file mode 100644 index 0000000..f79fc5c --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Package.appxmanifest @@ -0,0 +1,42 @@ + + + + + + + CaptureWatcherSample + Beatriz + Assets\StoreLogo.png + + + + 6.2.1 + 6.2.1 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Properties/AssemblyInfo.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..34de87a --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/Properties/AssemblyInfo.cs @@ -0,0 +1,29 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CaptureWatcherSample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CaptureWatcherSample")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/TreeHelper.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/TreeHelper.cs new file mode 100644 index 0000000..8218640 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/TreeHelper.cs @@ -0,0 +1,71 @@ +using System.Collections.Generic; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Media; + +namespace ZagStudio.Helpers +{ + public static class TreeHelper + { + public static IEnumerable Descendants(this DependencyObject element) where T : DependencyObject + { + if (element != null) + { + for (int i = 0; i < VisualTreeHelper.GetChildrenCount(element); i++) + { + DependencyObject child = VisualTreeHelper.GetChild(element, i); + T result = child as T; + if (result != null) + { + yield return result; + } + + foreach (T descendant in Descendants(child)) + { + yield return descendant; + } + } + } + } + + public static IEnumerable DescendantsAndSelf(this DependencyObject element) where T : DependencyObject + { + T result = element as T; + if (result != null) + { + yield return result; + } + + foreach (T descendant in Descendants(element)) + { + yield return descendant; + } + } + + public static IEnumerable Ancestors(this DependencyObject element) where T : DependencyObject + { + while (element != null) + { + element = VisualTreeHelper.GetParent(element); + T result = element as T; + if (result != null) + { + yield return result; + } + } + } + + public static IEnumerable AncestorsAndSelf(this DependencyObject element) where T : DependencyObject + { + T result = element as T; + if (result != null) + { + yield return result; + } + + foreach (T ancestor in Ancestors(element)) + { + yield return ancestor; + } + } + } +} diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/App.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/App.xaml new file mode 100644 index 0000000..f4de764 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/App.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/App.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/App.xaml new file mode 100644 index 0000000..f4de764 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/App.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/AppxManifest.xml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/AppxManifest.xml new file mode 100644 index 0000000..fe16127 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/AppxManifest.xml @@ -0,0 +1,42 @@ + + + + + + CaptureWatcherSample + Beatriz + Assets\StoreLogo.png + + + 6.2.1 + 6.2.1 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/Logo.png b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/Logo.png new file mode 100644 index 0000000..e26771c Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/Logo.png differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/SmallLogo.png b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/SmallLogo.png new file mode 100644 index 0000000..1eb0d9d Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/SmallLogo.png differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/SplashScreen.png b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/SplashScreen.png new file mode 100644 index 0000000..c951e03 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/SplashScreen.png differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/StoreLogo.png b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/StoreLogo.png new file mode 100644 index 0000000..dcb6727 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Assets/StoreLogo.png differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/CaptureWatcherSample.exe b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/CaptureWatcherSample.exe new file mode 100644 index 0000000..9a5edd6 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/CaptureWatcherSample.exe differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/CaptureWatcherSample.pdb b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/CaptureWatcherSample.pdb new file mode 100644 index 0000000..8bfbcc9 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/CaptureWatcherSample.pdb differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Common/StandardStyles.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Common/StandardStyles.xaml new file mode 100644 index 0000000..ceec3df --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/Common/StandardStyles.xaml @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mouse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/MainPage.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/MainPage.xaml new file mode 100644 index 0000000..b370a0c --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/MainPage.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/resources.pri b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/resources.pri new file mode 100644 index 0000000..70fb9ae Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/resources.pri differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/vs.appxrecipe b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/vs.appxrecipe new file mode 100644 index 0000000..8591dc2 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppX/vs.appxrecipe @@ -0,0 +1,70 @@ + + + + DELL-LATITUDE + Beatriz + Debug|AnyCPU + neutral + E7739820434B458DAA48A644C506B91B51AC1258B4C117373BC3EE7B568E61E4 + 6c5737ce-7d5a-47c8-8cf9-52d49a9b0244_1.0.0.0_neutral__mwdye0a0nrncr + 6c5737ce-7d5a-47c8-8cf9-52d49a9b0244_mwdye0a0nrncr!App + 6c5737ce-7d5a-47c8-8cf9-52d49a9b0244 + CN=Beatriz + 1.0.0.0 + + + + AppxManifest.xml + true + 2013-04-03T05:55:47.963 + + + + + CaptureWatcherSample.exe + 2013-04-04T04:51:54.635 + + + CaptureWatcherSample.pdb + 2013-04-04T04:51:54.505 + + + Assets\Logo.png + true + 2012-03-16T04:42:52.000 + + + Assets\SmallLogo.png + true + 2012-03-16T04:42:52.000 + + + Assets\SplashScreen.png + true + 2012-03-16T04:42:52.000 + + + Assets\StoreLogo.png + true + 2012-03-16T04:42:52.000 + + + App.xaml + 2013-04-03T05:11:16.602 + + + Common\StandardStyles.xaml + 2012-06-27T00:19:20.000 + + + MainPage.xaml + 2013-04-03T05:20:06.867 + + + resources.pri + 2013-04-03T05:19:24.032 + + + + + \ No newline at end of file diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppxManifest.xml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppxManifest.xml new file mode 100644 index 0000000..fe16127 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/AppxManifest.xml @@ -0,0 +1,42 @@ + + + + + + CaptureWatcherSample + Beatriz + Assets\StoreLogo.png + + + 6.2.1 + 6.2.1 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/CaptureWatcherSample.build.appxrecipe b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/CaptureWatcherSample.build.appxrecipe new file mode 100644 index 0000000..b817bcf --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/CaptureWatcherSample.build.appxrecipe @@ -0,0 +1,53 @@ + + + + DELL-LATITUDE + Beatriz + Debug|AnyCPU + neutral + + + + AppxManifest.xml + true + + + + + CaptureWatcherSample.exe + + + CaptureWatcherSample.pdb + + + Assets\Logo.png + true + + + Assets\SmallLogo.png + true + + + Assets\SplashScreen.png + true + + + Assets\StoreLogo.png + true + + + App.xaml + + + Common\StandardStyles.xaml + + + MainPage.xaml + + + resources.pri + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/CaptureWatcherSample.exe b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/CaptureWatcherSample.exe new file mode 100644 index 0000000..9a5edd6 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/CaptureWatcherSample.exe differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/CaptureWatcherSample.pdb b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/CaptureWatcherSample.pdb new file mode 100644 index 0000000..8bfbcc9 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/CaptureWatcherSample.pdb differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/Common/StandardStyles.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/Common/StandardStyles.xaml new file mode 100644 index 0000000..ceec3df --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/Common/StandardStyles.xaml @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mouse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/MainPage.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/MainPage.xaml new file mode 100644 index 0000000..b370a0c --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/MainPage.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/resources.pri b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/resources.pri new file mode 100644 index 0000000..70fb9ae Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/bin/Debug/resources.pri differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/App.g.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/App.g.cs new file mode 100644 index 0000000..e74811b --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/App.g.cs @@ -0,0 +1,27 @@ + + +#pragma checksum "C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "90AEAE53C86C5D16FE2D122BD4AD9050" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CaptureWatcherSample +{ + partial class App : global::Windows.UI.Xaml.Application, global::Windows.UI.Xaml.Markup.IComponentConnector + { + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + + public void Connect(int connectionId, object target) + { + this._contentLoaded = true; + } + } +} + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/App.g.i.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/App.g.i.cs new file mode 100644 index 0000000..1e0edac --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/App.g.i.cs @@ -0,0 +1,56 @@ + + +#pragma checksum "C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "90AEAE53C86C5D16FE2D122BD4AD9050" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +namespace CaptureWatcherSample +{ +#if !DISABLE_XAML_GENERATED_MAIN + public static class Program + { + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + static void Main(string[] args) + { + global::Windows.UI.Xaml.Application.Start((p) => new App()); + } + } +#endif + + partial class App : global::Windows.UI.Xaml.Application + { + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")] + private bool _contentLoaded; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() + { + if (_contentLoaded) + return; + + _contentLoaded = true; +#if DEBUG && !DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT + DebugSettings.BindingFailed += (sender, args) => + { + global::System.Diagnostics.Debug.WriteLine(args.Message); + }; +#endif +#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION + UnhandledException += (sender, e) => + { + if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break(); + }; +#endif + } + } +} + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/App.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/App.xaml new file mode 100644 index 0000000..f4de764 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/App.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/CaptureWatcherSample.csproj.FileListAbsolute.txt b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/CaptureWatcherSample.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..2e29a98 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/CaptureWatcherSample.csproj.FileListAbsolute.txt @@ -0,0 +1,23 @@ +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\CaptureWatcherSample.exe +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\CaptureWatcherSample.pdb +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\resources.pri +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\AppxManifest.xml +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\CaptureWatcherSample.build.appxrecipe +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\App.g.i.cs +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\App.g.cs +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\Common\StandardStyles.g.i.cs +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\Common\StandardStyles.g.cs +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\MainPage.g.i.cs +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\MainPage.g.cs +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\XamlTypeInfo.g.cs +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\App.xaml +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\Common\StandardStyles.xaml +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\MainPage.xaml +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\CaptureWatcherSample.exe +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\CaptureWatcherSample.pdb +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\priconfig.xml +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\layout.resfiles +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\resources.resfiles +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\pri.resfiles +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\LanguageQualifiers.txt +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\obj\Debug\ProjectArchitectures.txt diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/CaptureWatcherSample.exe b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/CaptureWatcherSample.exe new file mode 100644 index 0000000..9a5edd6 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/CaptureWatcherSample.exe differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/CaptureWatcherSample.pdb b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/CaptureWatcherSample.pdb new file mode 100644 index 0000000..8bfbcc9 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/CaptureWatcherSample.pdb differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/Common/StandardStyles.g.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/Common/StandardStyles.g.cs new file mode 100644 index 0000000..30259b2 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/Common/StandardStyles.g.cs @@ -0,0 +1 @@ + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/Common/StandardStyles.g.i.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/Common/StandardStyles.g.i.cs new file mode 100644 index 0000000..30259b2 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/Common/StandardStyles.g.i.cs @@ -0,0 +1 @@ + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/Common/StandardStyles.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/Common/StandardStyles.xaml new file mode 100644 index 0000000..ceec3df --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/Common/StandardStyles.xaml @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mouse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..b6329cd Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/LanguageQualifiers.txt b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/LanguageQualifiers.txt new file mode 100644 index 0000000..e69de29 diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/LanguageQualifiers.txt.intermediate b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/LanguageQualifiers.txt.intermediate new file mode 100644 index 0000000..e69de29 diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/MainPage.g.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/MainPage.g.cs new file mode 100644 index 0000000..7e611d3 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/MainPage.g.cs @@ -0,0 +1,48 @@ + + +#pragma checksum "C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "355EE149277504297A1A7500AC603305" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CaptureWatcherSample +{ + partial class MainPage : global::Windows.UI.Xaml.Controls.Page, global::Windows.UI.Xaml.Markup.IComponentConnector + { + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + + public void Connect(int connectionId, object target) + { + switch(connectionId) + { + case 1: + #line 24 "..\..\MainPage.xaml" + ((global::Windows.UI.Xaml.UIElement)(target)).PointerPressed += this.Canvas_PointerPressed; + #line default + #line hidden + #line 25 "..\..\MainPage.xaml" + ((global::Windows.UI.Xaml.UIElement)(target)).PointerMoved += this.Canvas_PointerMoved; + #line default + #line hidden + #line 26 "..\..\MainPage.xaml" + ((global::Windows.UI.Xaml.UIElement)(target)).PointerReleased += this.Canvas_PointerReleased; + #line default + #line hidden + #line 27 "..\..\MainPage.xaml" + ((global::Windows.UI.Xaml.UIElement)(target)).PointerCaptureLost += this.Canvas_PointerCaptureLost; + #line default + #line hidden + break; + } + this._contentLoaded = true; + } + } +} + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/MainPage.g.i.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/MainPage.g.i.cs new file mode 100644 index 0000000..bb68149 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/MainPage.g.i.cs @@ -0,0 +1,38 @@ + + +#pragma checksum "C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "355EE149277504297A1A7500AC603305" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CaptureWatcherSample +{ + partial class MainPage : global::Windows.UI.Xaml.Controls.Page + { + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")] + private global::Windows.UI.Xaml.Controls.Canvas canvas; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")] + private bool _contentLoaded; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() + { + if (_contentLoaded) + return; + + _contentLoaded = true; + global::Windows.UI.Xaml.Application.LoadComponent(this, new global::System.Uri("ms-appx:///MainPage.xaml"), global::Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); + + canvas = (global::Windows.UI.Xaml.Controls.Canvas)this.FindName("canvas"); + } + } +} + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/MainPage.xaml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/MainPage.xaml new file mode 100644 index 0000000..b370a0c --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/MainPage.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/ProjectArchitectures.txt b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/ProjectArchitectures.txt new file mode 100644 index 0000000..2195dd8 --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/ProjectArchitectures.txt @@ -0,0 +1 @@ +C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\CaptureWatcherSample.csproj;neutral diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs new file mode 100644 index 0000000..e69de29 diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/XamlTypeInfo.g.cs b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/XamlTypeInfo.g.cs new file mode 100644 index 0000000..e69de29 diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/XamlTypeInfo.g.cs.backup b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/XamlTypeInfo.g.cs.backup new file mode 100644 index 0000000..f75359e --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/XamlTypeInfo.g.cs.backup @@ -0,0 +1,459 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + +namespace CaptureWatcherSample +{ + public partial class App : global::Windows.UI.Xaml.Markup.IXamlMetadataProvider + { + private global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlTypeInfoProvider _provider; + + public global::Windows.UI.Xaml.Markup.IXamlType GetXamlType(global::System.Type type) + { + if(_provider == null) + { + _provider = new global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlTypeInfoProvider(); + } + return _provider.GetXamlTypeByType(type); + } + + public global::Windows.UI.Xaml.Markup.IXamlType GetXamlType(global::System.String fullName) + { + if(_provider == null) + { + _provider = new global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlTypeInfoProvider(); + } + return _provider.GetXamlTypeByName(fullName); + } + + public global::Windows.UI.Xaml.Markup.XmlnsDefinition[] GetXmlnsDefinitions() + { + return new global::Windows.UI.Xaml.Markup.XmlnsDefinition[0]; + } + } +} + +namespace CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo +{ + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal partial class XamlTypeInfoProvider + { + public global::Windows.UI.Xaml.Markup.IXamlType GetXamlTypeByType(global::System.Type type) + { + string standardName; + global::Windows.UI.Xaml.Markup.IXamlType xamlType = null; + if(_xamlTypeToStandardName.TryGetValue(type, out standardName)) + { + xamlType = GetXamlTypeByName(standardName); + } + else + { + xamlType = GetXamlTypeByName(type.FullName); + } + return xamlType; + } + + public global::Windows.UI.Xaml.Markup.IXamlType GetXamlTypeByName(string typeName) + { + if (global::System.String.IsNullOrEmpty(typeName)) + { + return null; + } + global::Windows.UI.Xaml.Markup.IXamlType xamlType; + if (_xamlTypes.TryGetValue(typeName, out xamlType)) + { + return xamlType; + } + xamlType = CreateXamlType(typeName); + if (xamlType != null) + { + _xamlTypes.Add(typeName, xamlType); + } + return xamlType; + } + + public global::Windows.UI.Xaml.Markup.IXamlMember GetMemberByLongName(string longMemberName) + { + if (global::System.String.IsNullOrEmpty(longMemberName)) + { + return null; + } + global::Windows.UI.Xaml.Markup.IXamlMember xamlMember; + if (_xamlMembers.TryGetValue(longMemberName, out xamlMember)) + { + return xamlMember; + } + xamlMember = CreateXamlMember(longMemberName); + if (xamlMember != null) + { + _xamlMembers.Add(longMemberName, xamlMember); + } + return xamlMember; + } + + global::System.Collections.Generic.Dictionary _xamlTypes = new global::System.Collections.Generic.Dictionary(); + global::System.Collections.Generic.Dictionary _xamlMembers = new global::System.Collections.Generic.Dictionary(); + global::System.Collections.Generic.Dictionary _xamlTypeToStandardName = new global::System.Collections.Generic.Dictionary(); + + private void AddToMapOfTypeToStandardName(global::System.Type t, global::System.String str) + { + if(!_xamlTypeToStandardName.ContainsKey(t)) + { + _xamlTypeToStandardName.Add(t, str); + } + } + + private object Activate_0_MainPage() { return new global::CaptureWatcherSample.MainPage(); } + + + private global::Windows.UI.Xaml.Markup.IXamlType CreateXamlType(string typeName) + { + global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlSystemBaseType xamlType = null; + global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlUserType userType; + + switch (typeName) + { + case "Windows.UI.Xaml.Controls.Page": + xamlType = new global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::Windows.UI.Xaml.Controls.Page)); + break; + + case "Windows.UI.Xaml.Controls.UserControl": + xamlType = new global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlSystemBaseType(typeName, typeof(global::Windows.UI.Xaml.Controls.UserControl)); + break; + + case "CaptureWatcherSample.MainPage": + userType = new global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlUserType(this, typeName, typeof(global::CaptureWatcherSample.MainPage), GetXamlTypeByName("Windows.UI.Xaml.Controls.Page")); + userType.Activator = Activate_0_MainPage; + xamlType = userType; + break; + + } + return xamlType; + } + + + + private global::Windows.UI.Xaml.Markup.IXamlMember CreateXamlMember(string longMemberName) + { + global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlMember xamlMember = null; + // No Local Properties + return xamlMember; + } + + } + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal class XamlSystemBaseType : global::Windows.UI.Xaml.Markup.IXamlType + { + string _fullName; + global::System.Type _underlyingType; + + public XamlSystemBaseType(string fullName, global::System.Type underlyingType) + { + _fullName = fullName; + _underlyingType = underlyingType; + } + + public string FullName { get { return _fullName; } } + + public global::System.Type UnderlyingType + { + get + { + return _underlyingType; + } + } + + virtual public global::Windows.UI.Xaml.Markup.IXamlType BaseType { get { throw new global::System.NotImplementedException(); } } + virtual public global::Windows.UI.Xaml.Markup.IXamlMember ContentProperty { get { throw new global::System.NotImplementedException(); } } + virtual public global::Windows.UI.Xaml.Markup.IXamlMember GetMember(string name) { throw new global::System.NotImplementedException(); } + virtual public bool IsArray { get { throw new global::System.NotImplementedException(); } } + virtual public bool IsCollection { get { throw new global::System.NotImplementedException(); } } + virtual public bool IsConstructible { get { throw new global::System.NotImplementedException(); } } + virtual public bool IsDictionary { get { throw new global::System.NotImplementedException(); } } + virtual public bool IsMarkupExtension { get { throw new global::System.NotImplementedException(); } } + virtual public bool IsBindable { get { throw new global::System.NotImplementedException(); } } + virtual public global::Windows.UI.Xaml.Markup.IXamlType ItemType { get { throw new global::System.NotImplementedException(); } } + virtual public global::Windows.UI.Xaml.Markup.IXamlType KeyType { get { throw new global::System.NotImplementedException(); } } + virtual public object ActivateInstance() { throw new global::System.NotImplementedException(); } + virtual public void AddToMap(object instance, object key, object item) { throw new global::System.NotImplementedException(); } + virtual public void AddToVector(object instance, object item) { throw new global::System.NotImplementedException(); } + virtual public void RunInitializer() { throw new global::System.NotImplementedException(); } + virtual public object CreateFromString(global::System.String input) { throw new global::System.NotImplementedException(); } + } + + internal delegate object Activator(); + internal delegate void AddToCollection(object instance, object item); + internal delegate void AddToDictionary(object instance, object key, object item); + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal class XamlUserType : global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlSystemBaseType + { + global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlTypeInfoProvider _provider; + global::Windows.UI.Xaml.Markup.IXamlType _baseType; + bool _isArray; + bool _isMarkupExtension; + bool _isBindable; + + string _contentPropertyName; + string _itemTypeName; + string _keyTypeName; + global::System.Collections.Generic.Dictionary _memberNames; + global::System.Collections.Generic.Dictionary _enumValues; + + public XamlUserType(global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlTypeInfoProvider provider, string fullName, global::System.Type fullType, global::Windows.UI.Xaml.Markup.IXamlType baseType) + :base(fullName, fullType) + { + _provider = provider; + _baseType = baseType; + } + + // --- Interface methods ---- + + override public global::Windows.UI.Xaml.Markup.IXamlType BaseType { get { return _baseType; } } + override public bool IsArray { get { return _isArray; } } + override public bool IsCollection { get { return (CollectionAdd != null); } } + override public bool IsConstructible { get { return (Activator != null); } } + override public bool IsDictionary { get { return (DictionaryAdd != null); } } + override public bool IsMarkupExtension { get { return _isMarkupExtension; } } + override public bool IsBindable { get { return _isBindable; } } + + override public global::Windows.UI.Xaml.Markup.IXamlMember ContentProperty + { + get { return _provider.GetMemberByLongName(_contentPropertyName); } + } + + override public global::Windows.UI.Xaml.Markup.IXamlType ItemType + { + get { return _provider.GetXamlTypeByName(_itemTypeName); } + } + + override public global::Windows.UI.Xaml.Markup.IXamlType KeyType + { + get { return _provider.GetXamlTypeByName(_keyTypeName); } + } + + override public global::Windows.UI.Xaml.Markup.IXamlMember GetMember(string name) + { + if (_memberNames == null) + { + return null; + } + string longName; + if (_memberNames.TryGetValue(name, out longName)) + { + return _provider.GetMemberByLongName(longName); + } + return null; + } + + override public object ActivateInstance() + { + return Activator(); + } + + override public void AddToMap(object instance, object key, object item) + { + DictionaryAdd(instance, key, item); + } + + override public void AddToVector(object instance, object item) + { + CollectionAdd(instance, item); + } + + override public void RunInitializer() + { + System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(UnderlyingType.TypeHandle); + } + + override public global::System.Object CreateFromString(global::System.String input) + { + if (_enumValues != null) + { + global::System.Int32 value = 0; + + string[] valueParts = input.Split(','); + + foreach (string valuePart in valueParts) + { + object partValue; + global::System.Int32 enumFieldValue = 0; + try + { + if (_enumValues.TryGetValue(valuePart.Trim(), out partValue)) + { + enumFieldValue = global::System.Convert.ToInt32(partValue); + } + else + { + try + { + enumFieldValue = global::System.Convert.ToInt32(valuePart.Trim()); + } + catch( global::System.FormatException ) + { + foreach( string key in _enumValues.Keys ) + { + if( global::System.String.Compare(valuePart.Trim(), key, global::System.StringComparison.OrdinalIgnoreCase) == 0 ) + { + if( _enumValues.TryGetValue(key.Trim(), out partValue) ) + { + enumFieldValue = global::System.Convert.ToInt32(partValue); + break; + } + } + } + } + } + value |= enumFieldValue; + } + catch( global::System.FormatException ) + { + throw new global::System.ArgumentException(input, FullName); + } + } + + return value; + } + throw new global::System.ArgumentException(input, FullName); + } + + // --- End of Interface methods + + public Activator Activator { get; set; } + public AddToCollection CollectionAdd { get; set; } + public AddToDictionary DictionaryAdd { get; set; } + + public void SetContentPropertyName(string contentPropertyName) + { + _contentPropertyName = contentPropertyName; + } + + public void SetIsArray() + { + _isArray = true; + } + + public void SetIsMarkupExtension() + { + _isMarkupExtension = true; + } + + public void SetIsBindable() + { + _isBindable = true; + } + + public void SetItemTypeName(string itemTypeName) + { + _itemTypeName = itemTypeName; + } + + public void SetKeyTypeName(string keyTypeName) + { + _keyTypeName = keyTypeName; + } + + public void AddMemberName(string shortName) + { + if(_memberNames == null) + { + _memberNames = new global::System.Collections.Generic.Dictionary(); + } + _memberNames.Add(shortName, FullName + "." + shortName); + } + + public void AddEnumValue(string name, object value) + { + if (_enumValues == null) + { + _enumValues = new global::System.Collections.Generic.Dictionary(); + } + _enumValues.Add(name, value); + } + } + + internal delegate object Getter(object instance); + internal delegate void Setter(object instance, object value); + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal class XamlMember : global::Windows.UI.Xaml.Markup.IXamlMember + { + global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlTypeInfoProvider _provider; + string _name; + bool _isAttachable; + bool _isDependencyProperty; + bool _isReadOnly; + + string _typeName; + string _targetTypeName; + + public XamlMember(global::CaptureWatcherSample.CaptureWatcherSample_XamlTypeInfo.XamlTypeInfoProvider provider, string name, string typeName) + { + _name = name; + _typeName = typeName; + _provider = provider; + } + + public string Name { get { return _name; } } + + public global::Windows.UI.Xaml.Markup.IXamlType Type + { + get { return _provider.GetXamlTypeByName(_typeName); } + } + + public void SetTargetTypeName(global::System.String targetTypeName) + { + _targetTypeName = targetTypeName; + } + public global::Windows.UI.Xaml.Markup.IXamlType TargetType + { + get { return _provider.GetXamlTypeByName(_targetTypeName); } + } + + public void SetIsAttachable() { _isAttachable = true; } + public bool IsAttachable { get { return _isAttachable; } } + + public void SetIsDependencyProperty() { _isDependencyProperty = true; } + public bool IsDependencyProperty { get { return _isDependencyProperty; } } + + public void SetIsReadOnly() { _isReadOnly = true; } + public bool IsReadOnly { get { return _isReadOnly; } } + + public Getter Getter { get; set; } + public object GetValue(object instance) + { + if (Getter != null) + return Getter(instance); + else + throw new global::System.InvalidOperationException("GetValue"); + } + + public Setter Setter { get; set; } + public void SetValue(object instance, object value) + { + if (Setter != null) + Setter(instance, value); + else + throw new global::System.InvalidOperationException("SetValue"); + } + } +} + + diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/intermediatexaml/CaptureWatcherSample.exe b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/intermediatexaml/CaptureWatcherSample.exe new file mode 100644 index 0000000..3bbff5f Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/intermediatexaml/CaptureWatcherSample.exe differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/intermediatexaml/CaptureWatcherSample.pdb b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/intermediatexaml/CaptureWatcherSample.pdb new file mode 100644 index 0000000..b8ad880 Binary files /dev/null and b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/intermediatexaml/CaptureWatcherSample.pdb differ diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/layout.resfiles b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/layout.resfiles new file mode 100644 index 0000000..21eb02d --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/layout.resfiles @@ -0,0 +1,7 @@ +Assets\Logo.png +Assets\SmallLogo.png +Assets\SplashScreen.png +Assets\StoreLogo.png +App.xaml +Common\StandardStyles.xaml +MainPage.xaml diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/pri.resfiles b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/pri.resfiles new file mode 100644 index 0000000..e69de29 diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/priconfig.xml b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/priconfig.xml new file mode 100644 index 0000000..3518abd --- /dev/null +++ b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/priconfig.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/resources.resfiles b/77-CaptureWatcher/CaptureWatcherSample/CaptureWatcherSample/obj/Debug/resources.resfiles new file mode 100644 index 0000000..e69de29 diff --git a/77-CaptureWatcher/Images/77CaptureWatcher.png b/77-CaptureWatcher/Images/77CaptureWatcher.png new file mode 100644 index 0000000..e7e6ac5 Binary files /dev/null and b/77-CaptureWatcher/Images/77CaptureWatcher.png differ diff --git a/77-CaptureWatcher/README.md b/77-CaptureWatcher/README.md new file mode 100644 index 0000000..8cd1850 --- /dev/null +++ b/77-CaptureWatcher/README.md @@ -0,0 +1,32 @@ +# How to debug pointer capture + +In our previous blog post, we mentioned some of the challenges developers face in creating keyboard-friendly applications, and we presented our FocusWatcher class for debugging these issues in Windows Store apps. The keyboard is just one way an app may receive input; Windows Store apps can also get input from mouse, stylus, and of course, touch. Modern tablets and touch screens often support multiple simultaneous touch inputs, in fact. All these different inputs can make it tough for developers to figure out what's going on, especially when combining many built-in controls and custom controls. + +In this post, we offer you a companion to the FocusWatcher class, called CaptureWatcher. This tool constantly monitors your application and reveals which elements have captured events from any of the available pointers, including mouse, stylus, and touch pointers. Here are just some of the issues that CaptureWatcher can help uncover: +• Failing to capture a pointer. It's important for controls to call UIElement.CapturePointer when the user starts dragging an element, otherwise pointer movement events will get lost as soon as the user moves the pointer outside the control. +• Failing to release a pointer capture. It's equally important to call UIElement.ReleasePointerCapture when the user finishes dragging, otherwise your control will continue to get pointer events when it shouldn't. +• Failing to distinguish between multiple pointers. With the advent of multitouch input, you have to decide whether to capture and process events from only one pointer or from many pointers, and pay attention to the PointerId of each event. +• Losing pointer capture. Your control may lose pointer capture to another control within the app, or to another app entirely. + +Like the FocusWatcher class, CaptureWatcher displays information in a text overlay. It lists the type and name of any element that has captured one or more pointers, followed by the type and ID of the captured pointers. The screenshot below shows that a Canvas element (named "canvas") has captured two touch pointers with IDs 133 and 134. + + + +Here's how to use CaptureWatcher in your own Windows Store application: +1. Download CaptureWatcher.zip. +2. Add CaptureWatcher.cs and TreeHelper.cs to your project. +3. In App.xaml.cs, within the app's OnLaunched method, just after calling Window.Current.Activate(), add a call to ZagStudio.Helpers.CaptureWatcher.Start(). +4. Build and run. + +Your code should look something like this: + + protected override void OnLaunched(LaunchActivatedEventArgs args) + { + ... + Window.Current.Activate(); + ZagStudio.Helpers.CaptureWatcher.Start(); + … + } + +Like FocusWatcher, you can also start and stop CaptureWatcher whenever you need to. We hope you find these tools helpful. + diff --git a/77-CaptureWatcher/TreeHelper.cs b/77-CaptureWatcher/TreeHelper.cs new file mode 100644 index 0000000..8218640 --- /dev/null +++ b/77-CaptureWatcher/TreeHelper.cs @@ -0,0 +1,71 @@ +using System.Collections.Generic; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Media; + +namespace ZagStudio.Helpers +{ + public static class TreeHelper + { + public static IEnumerable Descendants(this DependencyObject element) where T : DependencyObject + { + if (element != null) + { + for (int i = 0; i < VisualTreeHelper.GetChildrenCount(element); i++) + { + DependencyObject child = VisualTreeHelper.GetChild(element, i); + T result = child as T; + if (result != null) + { + yield return result; + } + + foreach (T descendant in Descendants(child)) + { + yield return descendant; + } + } + } + } + + public static IEnumerable DescendantsAndSelf(this DependencyObject element) where T : DependencyObject + { + T result = element as T; + if (result != null) + { + yield return result; + } + + foreach (T descendant in Descendants(element)) + { + yield return descendant; + } + } + + public static IEnumerable Ancestors(this DependencyObject element) where T : DependencyObject + { + while (element != null) + { + element = VisualTreeHelper.GetParent(element); + T result = element as T; + if (result != null) + { + yield return result; + } + } + } + + public static IEnumerable AncestorsAndSelf(this DependencyObject element) where T : DependencyObject + { + T result = element as T; + if (result != null) + { + yield return result; + } + + foreach (T ancestor in Ancestors(element)) + { + yield return ancestor; + } + } + } +}