This commit is contained in:
Beatriz Stollnitz 2019-08-05 21:07:56 -07:00
Родитель 6f60317175
Коммит dee2ba6b85
69 изменённых файлов: 9385 добавлений и 0 удалений

Просмотреть файл

@ -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<UIElement>())
{
IReadOnlyList<Pointer> 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 ---
}
}

Просмотреть файл

@ -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

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,20 @@
<Application
x:Class="CaptureWatcherSample.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CaptureWatcherSample">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--
Styles that define common aspects of the platform look and feel
Required by Visual Studio project and item templates
-->
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

Просмотреть файл

@ -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
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// 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().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}
/// <summary>
/// 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.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
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();
}
/// <summary>
/// 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.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
}
}

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 801 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 329 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 429 B

Просмотреть файл

@ -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<UIElement>())
{
IReadOnlyList<Pointer> 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 ---
}
}

Просмотреть файл

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3A050AFF-6785-4C6C-83ED-1DCB52A22DFD}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CaptureWatcherSample</RootNamespace>
<AssemblyName>CaptureWatcherSample</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>CaptureWatcherSample_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="CaptureWatcher.cs" />
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TreeHelper.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="CaptureWatcherSample_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\Logo.png" />
<Content Include="Assets\SmallLogo.png" />
<Content Include="Assets\SplashScreen.png" />
<Content Include="Assets\StoreLogo.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="Common\StandardStyles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0' ">
<VisualStudioVersion>11.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<UseSimulator>True</UseSimulator>
<RemoteDebugMachine>surface</RemoteDebugMachine>
<UseAuthentication>True</UseAuthentication>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
</PropertyGroup>
</Project>

Двоичный файл не отображается.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,29 @@
<Page
x:Class="CaptureWatcherSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CaptureWatcherSample"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="140"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="CaptureWatcher sample"
Style="{StaticResource PageHeaderTextStyle}"
Margin="120,0,0,0"/>
<Canvas x:Name="canvas"
Background="White"
Grid.Row="1"
Margin="120,40,120,80"
PointerPressed="Canvas_PointerPressed"
PointerMoved="Canvas_PointerMoved"
PointerReleased="Canvas_PointerReleased"
PointerCaptureLost="Canvas_PointerCaptureLost"/>
</Grid>
</Page>

Просмотреть файл

@ -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<uint, Ellipse> ellipses =
new Dictionary<uint,Ellipse>();
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;
}
}
}

Просмотреть файл

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Identity Name="6c5737ce-7d5a-47c8-8cf9-52d49a9b0244"
Publisher="CN=Beatriz"
Version="1.0.0.0" />
<Properties>
<DisplayName>CaptureWatcherSample</DisplayName>
<PublisherDisplayName>Beatriz</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.2.1</OSMinVersion>
<OSMaxVersionTested>6.2.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="CaptureWatcherSample.App">
<VisualElements
DisplayName="CaptureWatcherSample"
Logo="Assets\Logo.png"
SmallLogo="Assets\SmallLogo.png"
Description="CaptureWatcherSample"
ForegroundText="light"
BackgroundColor="#464646">
<DefaultTile ShowName="allLogos" />
<SplashScreen Image="Assets\SplashScreen.png" />
</VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

Просмотреть файл

@ -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)]

Просмотреть файл

@ -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<T> Descendants<T>(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<T>(child))
{
yield return descendant;
}
}
}
}
public static IEnumerable<T> DescendantsAndSelf<T>(this DependencyObject element) where T : DependencyObject
{
T result = element as T;
if (result != null)
{
yield return result;
}
foreach (T descendant in Descendants<T>(element))
{
yield return descendant;
}
}
public static IEnumerable<T> Ancestors<T>(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<T> AncestorsAndSelf<T>(this DependencyObject element) where T : DependencyObject
{
T result = element as T;
if (result != null)
{
yield return result;
}
foreach (T ancestor in Ancestors<T>(element))
{
yield return ancestor;
}
}
}
}

Просмотреть файл

@ -0,0 +1,21 @@
<Application
x:Class="CaptureWatcherSample.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CaptureWatcherSample">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--
Styles that define common aspects of the platform look and feel
Required by Visual Studio project and item templates
-->
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

Просмотреть файл

@ -0,0 +1,21 @@
<Application
x:Class="CaptureWatcherSample.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CaptureWatcherSample">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--
Styles that define common aspects of the platform look and feel
Required by Visual Studio project and item templates
-->
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

Просмотреть файл

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:build="http://schemas.microsoft.com/developer/appx/2012/build" IgnorableNamespaces="build">
<!--
THIS PACKAGE MANIFEST FILE IS GENERATED BY THE BUILD PROCESS.
Changes to this file will be lost when it is regenerated. To correct errors in this file, edit the source .appxmanifest file.
For more information on package manifest files, see http://go.microsoft.com/fwlink/?LinkID=241727
-->
<Identity Name="6c5737ce-7d5a-47c8-8cf9-52d49a9b0244" Publisher="CN=Beatriz" Version="1.0.0.0" ProcessorArchitecture="neutral" />
<Properties>
<DisplayName>CaptureWatcherSample</DisplayName>
<PublisherDisplayName>Beatriz</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.2.1</OSMinVersion>
<OSMaxVersionTested>6.2.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="EN-US" />
</Resources>
<Applications>
<Application Id="App" Executable="CaptureWatcherSample.exe" EntryPoint="CaptureWatcherSample.App">
<VisualElements DisplayName="CaptureWatcherSample" Logo="Assets\Logo.png" SmallLogo="Assets\SmallLogo.png" Description="CaptureWatcherSample" ForegroundText="light" BackgroundColor="#464646">
<DefaultTile ShowName="allLogos" />
<SplashScreen Image="Assets\SplashScreen.png" />
</VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
<build:Metadata>
<build:Item Name="TargetFrameworkMoniker" Value=".NETCore,Version=v4.5" />
<build:Item Name="VisualStudio" Version="11.0" />
<build:Item Name="OperatingSystem" Version="6.2.9200.16384 (win8_rtm.120725-1247)" />
<build:Item Name="Microsoft.Build.AppxPackage.dll" Version="11.0.51106.1" />
<build:Item Name="Microsoft.Windows.UI.Xaml.Build.Tasks.dll" Version="11.0.51106.1" />
<build:Item Name="MakePri.exe" Version="6.2.9200.16384 (win8_rtm.120725-1247)" />
</build:Metadata>
</Package>

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 801 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 329 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 429 B

Двоичный файл не отображается.

Двоичный файл не отображается.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,30 @@
<Page
x:Class="CaptureWatcherSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CaptureWatcherSample"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="140"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="CaptureWatcher sample"
Style="{StaticResource PageHeaderTextStyle}"
Margin="120,0,0,0"/>
<Canvas x:ConnectionId='1' x:Name="canvas"
Background="White"
Grid.Row="1"
Margin="120,40,120,80"
/>
</Grid>
</Page>

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Machine>DELL-LATITUDE</Machine>
<WindowsUser>Beatriz</WindowsUser>
<SolutionConfiguration>Debug|AnyCPU</SolutionConfiguration>
<PackageArchitecture>neutral</PackageArchitecture>
<RegisteredManifestChecksum>E7739820434B458DAA48A644C506B91B51AC1258B4C117373BC3EE7B568E61E4</RegisteredManifestChecksum>
<RegisteredPackageMoniker>6c5737ce-7d5a-47c8-8cf9-52d49a9b0244_1.0.0.0_neutral__mwdye0a0nrncr</RegisteredPackageMoniker>
<RegisteredUserModeAppID>6c5737ce-7d5a-47c8-8cf9-52d49a9b0244_mwdye0a0nrncr!App</RegisteredUserModeAppID>
<RegisteredPackageID>6c5737ce-7d5a-47c8-8cf9-52d49a9b0244</RegisteredPackageID>
<RegisteredPackagePublisher>CN=Beatriz</RegisteredPackagePublisher>
<RegisteredVersion>1.0.0.0</RegisteredVersion>
</PropertyGroup>
<ItemGroup>
<AppXManifest Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\AppxManifest.xml">
<PackagePath>AppxManifest.xml</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
<Modified>2013-04-03T05:55:47.963</Modified>
</AppXManifest>
</ItemGroup>
<ItemGroup>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\CaptureWatcherSample.exe">
<PackagePath>CaptureWatcherSample.exe</PackagePath>
<Modified>2013-04-04T04:51:54.635</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\CaptureWatcherSample.pdb">
<PackagePath>CaptureWatcherSample.pdb</PackagePath>
<Modified>2013-04-04T04:51:54.505</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\Assets\Logo.png">
<PackagePath>Assets\Logo.png</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
<Modified>2012-03-16T04:42:52.000</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\Assets\SmallLogo.png">
<PackagePath>Assets\SmallLogo.png</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
<Modified>2012-03-16T04:42:52.000</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\Assets\SplashScreen.png">
<PackagePath>Assets\SplashScreen.png</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
<Modified>2012-03-16T04:42:52.000</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\Assets\StoreLogo.png">
<PackagePath>Assets\StoreLogo.png</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
<Modified>2012-03-16T04:42:52.000</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\App.xaml">
<PackagePath>App.xaml</PackagePath>
<Modified>2013-04-03T05:11:16.602</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\Common\StandardStyles.xaml">
<PackagePath>Common\StandardStyles.xaml</PackagePath>
<Modified>2012-06-27T00:19:20.000</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\MainPage.xaml">
<PackagePath>MainPage.xaml</PackagePath>
<Modified>2013-04-03T05:20:06.867</Modified>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\resources.pri">
<PackagePath>resources.pri</PackagePath>
<Modified>2013-04-03T05:19:24.032</Modified>
</AppxPackagedFile>
</ItemGroup>
<ItemGroup>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:build="http://schemas.microsoft.com/developer/appx/2012/build" IgnorableNamespaces="build">
<!--
THIS PACKAGE MANIFEST FILE IS GENERATED BY THE BUILD PROCESS.
Changes to this file will be lost when it is regenerated. To correct errors in this file, edit the source .appxmanifest file.
For more information on package manifest files, see http://go.microsoft.com/fwlink/?LinkID=241727
-->
<Identity Name="6c5737ce-7d5a-47c8-8cf9-52d49a9b0244" Publisher="CN=Beatriz" Version="1.0.0.0" ProcessorArchitecture="neutral" />
<Properties>
<DisplayName>CaptureWatcherSample</DisplayName>
<PublisherDisplayName>Beatriz</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.2.1</OSMinVersion>
<OSMaxVersionTested>6.2.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="EN-US" />
</Resources>
<Applications>
<Application Id="App" Executable="CaptureWatcherSample.exe" EntryPoint="CaptureWatcherSample.App">
<VisualElements DisplayName="CaptureWatcherSample" Logo="Assets\Logo.png" SmallLogo="Assets\SmallLogo.png" Description="CaptureWatcherSample" ForegroundText="light" BackgroundColor="#464646">
<DefaultTile ShowName="allLogos" />
<SplashScreen Image="Assets\SplashScreen.png" />
</VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
<build:Metadata>
<build:Item Name="TargetFrameworkMoniker" Value=".NETCore,Version=v4.5" />
<build:Item Name="VisualStudio" Version="11.0" />
<build:Item Name="OperatingSystem" Version="6.2.9200.16384 (win8_rtm.120725-1247)" />
<build:Item Name="Microsoft.Build.AppxPackage.dll" Version="11.0.51106.1" />
<build:Item Name="Microsoft.Windows.UI.Xaml.Build.Tasks.dll" Version="11.0.51106.1" />
<build:Item Name="MakePri.exe" Version="6.2.9200.16384 (win8_rtm.120725-1247)" />
</build:Metadata>
</Package>

Просмотреть файл

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Machine>DELL-LATITUDE</Machine>
<WindowsUser>Beatriz</WindowsUser>
<SolutionConfiguration>Debug|AnyCPU</SolutionConfiguration>
<PackageArchitecture>neutral</PackageArchitecture>
</PropertyGroup>
<ItemGroup>
<AppXManifest Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\AppxManifest.xml">
<PackagePath>AppxManifest.xml</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
</AppXManifest>
</ItemGroup>
<ItemGroup>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\CaptureWatcherSample.exe">
<PackagePath>CaptureWatcherSample.exe</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\CaptureWatcherSample.pdb">
<PackagePath>CaptureWatcherSample.pdb</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\Assets\Logo.png">
<PackagePath>Assets\Logo.png</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\Assets\SmallLogo.png">
<PackagePath>Assets\SmallLogo.png</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\Assets\SplashScreen.png">
<PackagePath>Assets\SplashScreen.png</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\Assets\StoreLogo.png">
<PackagePath>Assets\StoreLogo.png</PackagePath>
<ReRegisterAppIfChanged>true</ReRegisterAppIfChanged>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\App.xaml">
<PackagePath>App.xaml</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\Common\StandardStyles.xaml">
<PackagePath>Common\StandardStyles.xaml</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\MainPage.xaml">
<PackagePath>MainPage.xaml</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\bin\Debug\resources.pri">
<PackagePath>resources.pri</PackagePath>
</AppxPackagedFile>
</ItemGroup>
<ItemGroup>
</ItemGroup>
</Project>

Двоичный файл не отображается.

Двоичный файл не отображается.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,30 @@
<Page
x:Class="CaptureWatcherSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CaptureWatcherSample"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="140"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="CaptureWatcher sample"
Style="{StaticResource PageHeaderTextStyle}"
Margin="120,0,0,0"/>
<Canvas x:ConnectionId='1' x:Name="canvas"
Background="White"
Grid.Row="1"
Margin="120,40,120,80"
/>
</Grid>
</Page>

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,27 @@

#pragma checksum "C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "90AEAE53C86C5D16FE2D122BD4AD9050"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}

Просмотреть файл

@ -0,0 +1,56 @@

#pragma checksum "C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "90AEAE53C86C5D16FE2D122BD4AD9050"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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
}
}
}

Просмотреть файл

@ -0,0 +1,21 @@
<Application
x:Class="CaptureWatcherSample.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CaptureWatcherSample">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--
Styles that define common aspects of the platform look and feel
Required by Visual Studio project and item templates
-->
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

Просмотреть файл

@ -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

Двоичный файл не отображается.

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1 @@


Просмотреть файл

@ -0,0 +1 @@


Разница между файлами не показана из-за своего большого размера Загрузить разницу

Двоичный файл не отображается.

Просмотреть файл

Просмотреть файл

@ -0,0 +1,48 @@

#pragma checksum "C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "355EE149277504297A1A7500AC603305"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}

Просмотреть файл

@ -0,0 +1,38 @@

#pragma checksum "C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "355EE149277504297A1A7500AC603305"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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");
}
}
}

Просмотреть файл

@ -0,0 +1,30 @@
<Page
x:Class="CaptureWatcherSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CaptureWatcherSample"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="140"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="CaptureWatcher sample"
Style="{StaticResource PageHeaderTextStyle}"
Margin="120,0,0,0"/>
<Canvas x:ConnectionId='1' x:Name="canvas"
Background="White"
Grid.Row="1"
Margin="120,40,120,80"
/>
</Grid>
</Page>

Просмотреть файл

@ -0,0 +1 @@
C:\Work\Web Sites\Blog development\BlogPosts\77CaptureWatcher\CaptureWatcherSample\CaptureWatcherSample\CaptureWatcherSample.csproj;neutral

Просмотреть файл

Просмотреть файл

@ -0,0 +1,459 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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<string, global::Windows.UI.Xaml.Markup.IXamlType> _xamlTypes = new global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlType>();
global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlMember> _xamlMembers = new global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlMember>();
global::System.Collections.Generic.Dictionary<global::System.Type, string> _xamlTypeToStandardName = new global::System.Collections.Generic.Dictionary<global::System.Type, string>();
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<string, string> _memberNames;
global::System.Collections.Generic.Dictionary<string, object> _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<string,string>();
}
_memberNames.Add(shortName, FullName + "." + shortName);
}
public void AddEnumValue(string name, object value)
{
if (_enumValues == null)
{
_enumValues = new global::System.Collections.Generic.Dictionary<string, object>();
}
_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");
}
}
}

Двоичный файл не отображается.

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,7 @@
Assets\Logo.png
Assets\SmallLogo.png
Assets\SplashScreen.png
Assets\StoreLogo.png
App.xaml
Common\StandardStyles.xaml
MainPage.xaml

Просмотреть файл

Просмотреть файл

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<index root="\" startIndexAt="obj\Debug\layout.resfiles">
<default>
<qualifier name="language" value="en-US" />
</default>
<indexer-config type="RESFILES" qualifierDelimiter="." />
</index>
<index root="\" startIndexAt="obj\Debug\resources.resfiles">
<default>
<qualifier name="language" value="en-US" />
</default>
<indexer-config type="RESW" convertDotsToSlashes="true" />
<indexer-config type="RESJSON" />
<indexer-config type="RESFILES" qualifierDelimiter="." />
</index>
<index root="\" startIndexAt="obj\Debug\pri.resfiles">
<default>
<qualifier name="language" value="en-US" />
</default>
<indexer-config type="PRI" />
<indexer-config type="RESFILES" qualifierDelimiter="." />
</index>
</resources>

Просмотреть файл

Двоичные данные
77-CaptureWatcher/Images/77CaptureWatcher.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 16 KiB

Просмотреть файл

@ -0,0 +1,32 @@
# How to debug pointer capture
In our <a href="http://www.zagstudio.com/blog/1335">previous blog post</a>, 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.
<img src="Images/77CaptureWatcher.png" class="postImage" />
Here's how to use CaptureWatcher in your own Windows Store application:
1. Download <a href="http://www.zagstudio.com/blogfiles/77/CaptureWatcher.zip">CaptureWatcher.zip</a>.
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.

Просмотреть файл

@ -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<T> Descendants<T>(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<T>(child))
{
yield return descendant;
}
}
}
}
public static IEnumerable<T> DescendantsAndSelf<T>(this DependencyObject element) where T : DependencyObject
{
T result = element as T;
if (result != null)
{
yield return result;
}
foreach (T descendant in Descendants<T>(element))
{
yield return descendant;
}
}
public static IEnumerable<T> Ancestors<T>(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<T> AncestorsAndSelf<T>(this DependencyObject element) where T : DependencyObject
{
T result = element as T;
if (result != null)
{
yield return result;
}
foreach (T ancestor in Ancestors<T>(element))
{
yield return ancestor;
}
}
}
}