This commit is contained in:
martinivanoff 2018-12-18 12:14:25 +02:00
Родитель aaeaa6e5d1
Коммит 2047d43cba
56 изменённых файлов: 2819 добавлений и 10 удалений

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

@ -105,6 +105,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AxisLikeAnnotations", "Axis
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ErrorBars", "ErrorBars\ErrorBars.csproj", "{3DCF18D5-6A82-4861-85C7-7F177E3D6828}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataVirtualization", "DataVirtualization\DataVirtualization.csproj", "{3529A289-59B7-49F8-A306-3AA51BBC53B4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug.NoXaml|Any CPU = Debug.NoXaml|Any CPU
@ -3666,6 +3668,120 @@ Global
{3DCF18D5-6A82-4861-85C7-7F177E3D6828}.ReleaseTrial451|Mixed Platforms.Build.0 = Release|Any CPU
{3DCF18D5-6A82-4861-85C7-7F177E3D6828}.ReleaseTrial451|x86.ActiveCfg = Release|Any CPU
{3DCF18D5-6A82-4861-85C7-7F177E3D6828}.ReleaseTrial451|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

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

@ -0,0 +1,9 @@
<Application x:Class="DataVirtualization.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DataVirtualization"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

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

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
namespace DataVirtualization
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

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

@ -0,0 +1,105 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using Telerik.Windows.Controls;
namespace DataVirtualization
{
public class ChartDataVirtualizationViewModel : ViewModelBase
{
private const int FullDataCount = 1000000;
private const double RangeOffset = 0.01;
private static Random randomNumberGenerator = new Random();
private ObservableCollection<PlotInfo> fullData;
private ObservableCollection<PlotInfo> visibleData;
private double minimumX;
private double maximumX;
public ChartDataVirtualizationViewModel()
{
this.fullData = this.GenerateFullData();
this.MinimumX = this.fullData.FirstOrDefault().XValue;
this.MaximumX = this.fullData.LastOrDefault().XValue;
this.visibleData = new ObservableCollection<PlotInfo>();
}
public double MinimumX
{
get { return this.minimumX; }
set
{
if (this.minimumX != value)
{
this.minimumX = value;
this.OnPropertyChanged("MinimumX");
}
}
}
public double MaximumX
{
get { return this.maximumX; }
set
{
if (this.maximumX != value)
{
this.maximumX = value;
this.OnPropertyChanged("MaximumX");
}
}
}
public ObservableCollection<PlotInfo> FullData
{
get { return this.fullData; }
}
public ObservableCollection<PlotInfo> VisibleData
{
get { return this.visibleData; }
private set
{
if (this.visibleData != value)
{
this.visibleData = value;
this.OnPropertyChanged("VisibleData");
}
}
}
public void UpdateVisibleData(double minimum, double maximum)
{
double delta = maximum - minimum;
double offset = delta * RangeOffset;
double offsetMinimum = minimum - offset;
double offsetMaximum = maximum + offset;
this.VisibleData = this.GetVisibleItems(offsetMinimum, offsetMaximum);
}
private ObservableCollection<PlotInfo> GetVisibleItems(double minimum, double maximum)
{
ObservableCollection<PlotInfo> result = new ObservableCollection<PlotInfo>();
for (int i = 0; i < this.fullData.Count; i++)
{
PlotInfo info = this.fullData[i];
if (minimum <= info.XValue && info.XValue <= maximum)
{
result.Add(info);
}
}
return result;
}
private ObservableCollection<PlotInfo> GenerateFullData()
{
ObservableCollection<PlotInfo> result = new ObservableCollection<PlotInfo>();
for (int i = 0; i < FullDataCount; i++)
{
result.Add(new PlotInfo() { XValue = i, YValue = randomNumberGenerator.Next(100, 300) });
}
return result;
}
}
}

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

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{3529A289-59B7-49F8-A306-3AA51BBC53B4}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>DataVirtualization</RootNamespace>
<AssemblyName>DataVirtualization</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</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</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</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="SharpDX, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.dll</HintPath>
</Reference>
<Reference Include="SharpDX.D3DCompiler, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.D3DCompiler.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Direct2D1">
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.Direct2D1.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Direct3D10">
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.Direct3D10.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Direct3D9, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.Direct3D9.dll</HintPath>
</Reference>
<Reference Include="SharpDX.DXGI, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.DXGI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="Telerik.Windows.Cloud, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Cloud.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls.Chart, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Chart.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls.Chart.Direct2D, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Chart.Direct2D.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Data, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Data.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="ChartDataVirtualizationViewModel.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="PlotInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Resource Include="Readme.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

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

@ -0,0 +1,32 @@
<Window x:Class="DataVirtualization.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<telerik:RadCartesianChart MaxZoom="100, 100"
MinZoom="100, 1">
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis />
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:LinearAxis Minimum="{Binding MinimumX, Mode=TwoWay}"
Maximum="{Binding MaximumX, Mode=TwoWay}"
ActualVisibleRangeChanged="LinearAxis_ActualVisibleRangeChanged"/>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.Series>
<telerik:ScatterLineSeries XValueBinding="XValue" YValueBinding="YValue" ItemsSource="{Binding VisibleData}">
<telerik:ScatterLineSeries.RenderOptions>
<telerik:Direct2DRenderOptions />
</telerik:ScatterLineSeries.RenderOptions>
</telerik:ScatterLineSeries>
</telerik:RadCartesianChart.Series>
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" DragMode="Pan"/>
</telerik:RadCartesianChart.Behaviors>
</telerik:RadCartesianChart>
</Grid>
</Window>

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

@ -0,0 +1,20 @@
using System.Windows;
namespace DataVirtualization
{
public partial class MainWindow : Window
{
ChartDataVirtualizationViewModel model;
public MainWindow()
{
InitializeComponent();
this.DataContext = this.model = new ChartDataVirtualizationViewModel();
}
private void LinearAxis_ActualVisibleRangeChanged(object sender, Telerik.Charting.NumericalRangeChangedEventArgs e)
{
this.model.UpdateVisibleData(e.NewRange.Minimum, e.NewRange.Maximum);
}
}
}

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

@ -0,0 +1,8 @@
namespace DataVirtualization
{
public class PlotInfo
{
public double XValue { get; set; }
public double YValue { get; set; }
}
}

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

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("DataVirtualization")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataVirtualization")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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")]

71
ChartView/WPF/DataVirtualization/Properties/Resources.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DataVirtualization.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataVirtualization.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

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

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

30
ChartView/WPF/DataVirtualization/Properties/Settings.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DataVirtualization.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

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

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

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

@ -0,0 +1,5 @@
## Data Virtualization ##
This example shows how to implement a basic data virtualization. This way the chart will create DataPoint objects only for the items in the viewport, thus noticeably improving the memory footprint in large data scenarios.
<keywords: scatterlineseries, actualvisiblerange>

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

@ -1,5 +1,5 @@
## ErrorBars ##
This article shows how to achieve an error bars visualization using RangeBarSeries and custom PointTemplate.
This example shows how to achieve an error bars visualization using RangeBarSeries and custom PointTemplate.
<keywords: rangebarseries, pointtemplate>

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

@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2018
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlShape_WPF", "ControlShape\ControlShape_WPF.csproj", "{0A7B9791-6F96-4DFD-A0CF-2B8A6E5B21E9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GlidingConnector_WPF", "GlidingConnector\GlidingConnector_WPF.csproj", "{DA8BFA8F-B0EC-4B6A-9592-E06710FAA48F}"
@ -51,11 +53,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GlyphToolBox", "GlyphToolBo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SortTreeLayoutShapes_WPF", "SortTreeLayoutShapes\SortTreeLayoutShapes_WPF.csproj", "{FF81B116-53D2-4BD5-B13A-9487D28E8FCD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExportToHighQualityImage_WPF", "ExportToHighQualityImage\ExportToHighQualityImage_WPF.csproj", "{24937FA6-2071-4F09-9921-BD3022353A55}"
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = Diagrams_WPF_Work.vsmdi
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
@ -315,8 +315,27 @@ Global
{FF81B116-53D2-4BD5-B13A-9487D28E8FCD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{FF81B116-53D2-4BD5-B13A-9487D28E8FCD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{FF81B116-53D2-4BD5-B13A-9487D28E8FCD}.Release|x86.ActiveCfg = Release|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Debug|x86.ActiveCfg = Debug|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Debug|x86.Build.0 = Debug|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Release|Any CPU.Build.0 = Release|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Release|x86.ActiveCfg = Release|Any CPU
{24937FA6-2071-4F09-9921-BD3022353A55}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BE28AEBD-B4FB-4BAA-B15C-76807A3CEAB1}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = Diagrams_WPF_Work.vsmdi
EndGlobalSection
EndGlobal

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

@ -0,0 +1,9 @@
<Application x:Class="ExportToHighQualityImage.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ExportToHighQualityImage"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

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

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
namespace ExportToHighQualityImage
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

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

@ -0,0 +1,151 @@
using System;
using System.IO;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.Diagrams;
using Telerik.Windows.Diagrams.Core;
namespace ExportToHighQualityImage
{
public static class CustomExportExtensions
{
private const int ImageTileRows = 6;
private const int ImageTileColumns = 6;
public static void ExportToImage(RadDiagram diagram, Stream stream, BitmapEncoder encoder = null, Rect? enclosingBounds = null, Size returnImageSize = new Size(), Brush backgroundBrush = null, Thickness margin = new Thickness(), double dpi = 96)
{
if (enclosingBounds == null)
{
enclosingBounds = diagram.CalculateEnclosingBounds();
}
if (encoder == null)
{
encoder = new PngBitmapEncoder();
}
var image = CreateDiagramImage(diagram, enclosingBounds.Value, returnImageSize, backgroundBrush, margin, dpi);
if (image != null)
{
encoder.Frames.Add(BitmapFrame.Create(image));
encoder.Save(stream);
}
}
private static BitmapSource CreateDiagramImage(RadDiagram diagram, Rect enclosingBounds, Size returnImageSize, Brush backgroundBrush, Thickness margin, double dpi)
{
var virtualizationService = diagram.ServiceLocator.GetService<IVirtualizationService>() as VirtualizationService;
virtualizationService.ForceRealization();
diagram.UpdateLayout();
var itemsHost = diagram.FindChildByType<DiagramSurface>();
BitmapSource image = CreateWriteableBitmap(itemsHost, enclosingBounds, returnImageSize, backgroundBrush, margin, dpi);
virtualizationService.Virtualize();
diagram.UpdateLayout();
return image;
}
private static BitmapSource CreateWriteableBitmap(UIElement element, Rect enclosingBounds, Size returnImageSize, Brush backgroundBrush, Thickness margin, double dpi = 96)
{
var expandedBounds = enclosingBounds.InflateRect(margin.Left, margin.Top, margin.Right, margin.Bottom);
if (element == null || IsSizeValid(returnImageSize) == false ||
enclosingBounds.IsValidBounds() == false || expandedBounds.IsValidBounds() == false)
{
return null;
}
if (returnImageSize.Width <= 0 || returnImageSize.Height <= 0)
{
returnImageSize = expandedBounds.ToSize();
}
var scale = new ScaleTransform();
if (expandedBounds.Width > 0 || expandedBounds.Height > 0)
{
scale.ScaleX = returnImageSize.Width / expandedBounds.Width;
scale.ScaleY = returnImageSize.Height / expandedBounds.Height;
}
dpi = CoerceDpi(dpi);
double dpiScale = dpi / 96.0;
var scaledwidth = (int)(returnImageSize.Width * dpiScale);
var scaledHeight = (int)(returnImageSize.Height * dpiScale);
var transformation = new TransformGroup();
transformation.Children.Add(scale);
var drawingVisual = new DrawingVisual();
using (var drawingContext = drawingVisual.RenderOpen())
{
drawingContext.PushTransform(transformation);
if (backgroundBrush != null)
{
drawingContext.DrawRectangle(backgroundBrush, null, new Rect(new Point(0, 0), expandedBounds.ToSize()));
}
DrawTiles(element, expandedBounds, drawingContext);
}
var renderTarget = new RenderTargetBitmap(scaledwidth, scaledHeight, dpi, dpi, PixelFormats.Pbgra32);
renderTarget.Render(drawingVisual);
var bitmap = new WriteableBitmap(renderTarget);
return bitmap;
}
private static Random r = new Random();
private static void DrawTiles(UIElement renderSurface, Rect shapesBounds, DrawingContext drawingContext)
{
double tileWidth = Math.Ceiling(shapesBounds.Width / ImageTileColumns) + 1;
double tileHeight = Math.Ceiling(shapesBounds.Height / ImageTileRows) + 1;
for (int rowIndex = 0; rowIndex < ImageTileRows; rowIndex++)
{
for (int colIndex = 0; colIndex < ImageTileColumns; colIndex++)
{
var x = Math.Floor(colIndex * tileWidth);
var y = Math.Floor(rowIndex * tileHeight);
var sourceX = Math.Floor(shapesBounds.Left) + x;
var sourceY = Math.Floor(shapesBounds.Top) + y;
var sourceBrush = new VisualBrush(renderSurface)
{
Stretch = Stretch.None,
Viewbox = new Rect(sourceX, sourceY, tileWidth, tileHeight),
ViewboxUnits = BrushMappingMode.Absolute
};
Rect drawingContextPortionRect = new Rect(x, y, tileWidth, tileHeight);
// The GuidelineSet is used in order to align the drawn tile to physical device pixels.
// Otherwise, you can observe blurred lines ot the tiles borders which leads to faded vertical and horizontal lines that goes accross the exported picture.
GuidelineSet guidelines = new GuidelineSet();
guidelines.GuidelinesX.Add(drawingContextPortionRect.Left);
guidelines.GuidelinesX.Add(drawingContextPortionRect.Right);
guidelines.GuidelinesY.Add(drawingContextPortionRect.Top);
guidelines.GuidelinesY.Add(drawingContextPortionRect.Bottom);
drawingContext.PushGuidelineSet(guidelines);
drawingContext.DrawRectangle(sourceBrush, null, drawingContextPortionRect);
}
}
}
private static bool IsSizeValid(Size size)
{
return !(size.Width.IsNanOrInfinity() || size.Height.IsNanOrInfinity());
}
private static double CoerceDpi(double dpi)
{
return (dpi > 0 && !dpi.IsNanOrInfinity()) ? dpi : 96d;
}
}
}

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

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{24937FA6-2071-4F09-9921-BD3022353A55}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>ExportToHighQualityImage</RootNamespace>
<AssemblyName>ExportToHighQualityImage</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</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</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</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="Telerik.Windows.Controls, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls.Diagrams, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Diagrams.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Data, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Data.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Diagrams.Core, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Diagrams.Core.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="CustomExportExtensions.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="readme.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

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

@ -0,0 +1,26 @@
<Window x:Class="ExportToHighQualityImage.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ExportToHighQualityImage"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<telerik:RadDiagram x:Name="diagram" Zoom="0.25">
<telerik:RadDiagramShape Content="Shape 1" Position="150, 100" Width="1200" Height="500"/>
<telerik:RadDiagramShape Content="Shape 2" Position="1100, 700" />
<telerik:RadDiagramShape Content="Shape 3" Position="2300, 1200" />
</telerik:RadDiagram>
<Border Background="Bisque" Grid.Column="1">
<telerik:RadButton Content="Export to image" Click="Button_Click" VerticalAlignment="Top" Padding="10" Margin="3"/>
</Border>
</Grid>
</Window>

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

@ -0,0 +1,33 @@
using Microsoft.Win32;
using System.IO;
using System.Windows;
using System.Windows.Media;
using Telerik.Windows.Controls;
using Telerik.Windows.Diagrams.Core;
namespace ExportToHighQualityImage
{
public partial class MainWindow : Window
{
public MainWindow()
{
StyleManager.ApplicationTheme = new Office2013Theme();
DiagramConstants.MinimumZoom = 0.25;
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
SaveFileDialog dialog = new SaveFileDialog();
dialog.Filter = "Image Files|*.jpg;*.png";
if (dialog.ShowDialog() == true)
{
using (var stream = File.Create(dialog.FileName))
{
CustomExportExtensions.ExportToImage(this.diagram, stream, backgroundBrush: Brushes.White, dpi: 500, margin: new Thickness(20));
}
}
}
}
}

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

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("ExportToHighQualityImage")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ExportToHighQualityImage")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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")]

71
Diagram/ExportToHighQualityImage/Properties/Resources.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ExportToHighQualityImage.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ExportToHighQualityImage.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

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

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

30
Diagram/ExportToHighQualityImage/Properties/Settings.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ExportToHighQualityImage.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

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

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

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

@ -0,0 +1,5 @@
## Export to High Quality Image ##
This example shows how to implement custom export that allows you to export diagrams that are very large in size.
<keywords: tiles, png, savefiledialog, bitmap, drawingcontext, drawingvisual>

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

@ -0,0 +1,9 @@
<Application x:Class="CustomArrowCue.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CustomArrowCue"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

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

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
namespace CustomArrowCue
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

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

@ -0,0 +1,62 @@
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;
namespace CustomArrowCue
{
public sealed class ArrowShape : Shape
{
public double X1 { get; set; }
public double Y1 { get; set; }
public double X2 { get; set; }
public double Y2 { get; set; }
public double HeadWidth { get; set; }
public double HeadHeight { get; set; }
private static Tuple<Point, Point> GetArrowPoints(Point startPoint, Point endPoint, double arrowWidth, double arrowHeight)
{
arrowHeight = arrowHeight / 2;
double theta = Math.Atan2(startPoint.Y - endPoint.Y, startPoint.X - endPoint.X);
double sint = Math.Round(Math.Sin(theta), 2);
double cost = Math.Round(Math.Cos(theta), 2);
Point leftPoint = new Point(endPoint.X + ((arrowWidth * cost) - (arrowHeight * sint)), endPoint.Y + ((arrowWidth * sint) + (arrowHeight * cost)));
Point rightPoint = new Point(endPoint.X + ((arrowWidth * cost) + (arrowHeight * sint)), endPoint.Y - ((arrowHeight * cost) - (arrowWidth * sint)));
return new Tuple<Point, Point>(leftPoint, rightPoint);
}
public void UpdateGeometry()
{
this.InvalidateVisual();
}
protected override Geometry DefiningGeometry
{
get { return this.CreateArrowGeometry(); }
}
private StreamGeometry CreateArrowGeometry()
{
StreamGeometry geometry = new StreamGeometry() { FillRule = FillRule.EvenOdd };
using (StreamGeometryContext context = geometry.Open())
{
Point startPoint = new Point(X1, this.Y1);
Point endPoint = new Point(X2, this.Y2);
Tuple<Point, Point> arrowPoints = GetArrowPoints(startPoint, endPoint, this.HeadWidth, this.HeadHeight);
Point leftPoint = arrowPoints.Item1;
Point rightPoint = arrowPoints.Item2;
context.BeginFigure(startPoint, true, false);
context.LineTo(endPoint, true, true);
context.LineTo(leftPoint, true, true);
context.LineTo(endPoint, true, true);
context.LineTo(rightPoint, true, true);
}
geometry.Freeze();
return geometry;
}
}
}

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

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{296A608D-6662-4A11-A731-0017CDC61892}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>CustomArrowCue</RootNamespace>
<AssemblyName>CustomArrowCue</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</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</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</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="Telerik.Windows.Controls, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="ArrowShape.cs" />
<Compile Include="DragDropManagerUtilities.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Resource Include="Readme.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

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

@ -0,0 +1,123 @@
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using Telerik.Windows.DragDrop;
namespace CustomArrowCue
{
public static class DragDropManagerUtilities
{
private const double dragStartThreshold = 5;
private static readonly Point EndPointOffset = new Point(3, 3);
private static bool allowDropCache;
private static Popup arrowContainer;
private static ArrowShape arrowVisual;
private static FrameworkElement rootVisual;
static DragDropManagerUtilities()
{
rootVisual = App.Current.MainWindow;
arrowVisual = new ArrowShape();
arrowVisual.HeadHeight = 10;
arrowVisual.HeadWidth = 10;
arrowVisual.Stroke = Brushes.RoyalBlue;
arrowVisual.StrokeThickness = 3;
arrowContainer = new Popup();
arrowContainer.AllowsTransparency = true;
arrowContainer.AllowDrop = true;
arrowContainer.IsHitTestVisible = false;
arrowContainer.Placement = PlacementMode.Relative;
arrowContainer.PlacementTarget = rootVisual;
arrowContainer.Child = arrowVisual;
DragDropManager.AddDragOverHandler(rootVisual, OnWindowDragOver, true);
}
public static readonly DependencyProperty ShowArrowDragCueProperty =
DependencyProperty.RegisterAttached(
"ShowArrowDragCue",
typeof(bool),
typeof(DragDropManagerUtilities),
new PropertyMetadata(false, OnShowArrowDragCueChanged));
public static bool GetShowArrowDragCue(DependencyObject obj)
{
return (bool)obj.GetValue(ShowArrowDragCueProperty);
}
public static void SetShowArrowDragCue(DependencyObject obj, bool value)
{
obj.SetValue(ShowArrowDragCueProperty, value);
}
private static void OnShowArrowDragCueChanged(DependencyObject target, DependencyPropertyChangedEventArgs args)
{
var element = (FrameworkElement)target;
if ((bool)args.NewValue)
{
DragDropManager.AddDragInitializeHandler(element, OnElementDragInitialize, true);
DragDropManager.AddDragDropCompletedHandler(element, OnElementDragDropCompleted, true);
element.Unloaded += OnElementUnloaded;
}
else
{
UnsubscribeFromEvents(element);
}
}
private static void OnElementDragInitialize(object sender, DragInitializeEventArgs e)
{
arrowContainer.Width = rootVisual.ActualWidth;
arrowContainer.Height = rootVisual.ActualHeight;
var position = Mouse.GetPosition(rootVisual);
arrowVisual.X1 = arrowVisual.X2 = position.X;
arrowVisual.Y1 = arrowVisual.Y2 = position.Y;
allowDropCache = rootVisual.AllowDrop;
rootVisual.AllowDrop = true;
}
private static void OnElementDragDropCompleted(object sender, DragDropCompletedEventArgs e)
{
arrowContainer.IsOpen = false;
rootVisual.AllowDrop = allowDropCache;
}
private static void OnWindowDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
{
if (e.AllowedEffects != DragDropEffects.None)
{
var position = e.GetPosition(rootVisual) - EndPointOffset;
arrowVisual.X2 = position.X;
arrowVisual.Y2 = position.Y;
arrowVisual.UpdateGeometry();
if (!arrowContainer.IsOpen &&
GetDistance(arrowVisual.X1, arrowVisual.Y1, arrowVisual.X2, arrowVisual.Y2) >= dragStartThreshold)
{
arrowContainer.IsOpen = true;
}
}
}
private static void UnsubscribeFromEvents(FrameworkElement element)
{
DragDropManager.RemoveDragInitializeHandler(element, OnElementDragInitialize);
DragDropManager.RemoveDragDropCompletedHandler(element, OnElementDragDropCompleted);
element.Unloaded -= OnElementUnloaded;
}
private static void OnElementUnloaded(object sender, RoutedEventArgs e)
{
UnsubscribeFromEvents((FrameworkElement)sender);
}
private static double GetDistance(double x1, double y1, double x2, double y2)
{
return Point.Subtract(new Point(x2, y2), new Point(x1, y1)).Length;
}
}
}

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

@ -0,0 +1,40 @@
<Window x:Class="CustomArrowCue.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CustomArrowCue"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Border x:Name="border1"
Background="YellowGreen"
BorderThickness="2"
BorderBrush="Crimson"
Width="100" Height="100"
telerik:DragDropManager.AllowDrag="True"
local:DragDropManagerUtilities.ShowArrowDragCue="True">
<TextBlock Text="Drag Source"
VerticalAlignment="Center"
TextAlignment="Center"
Foreground="White"/>
</Border>
<Border x:Name="border2" Background="YellowGreen"
BorderThickness="2" BorderBrush="Crimson"
Width="100" Height="100" Grid.Column="1"
Opacity="0.5">
<TextBlock Text="Drop Target"
VerticalAlignment="Center"
TextAlignment="Center"
Foreground="White"/>
</Border>
</Grid>
</Grid>
</Window>

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

@ -0,0 +1,27 @@
using System.Windows;
using System.Windows.Controls;
using Telerik.Windows.DragDrop;
namespace CustomArrowCue
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DragDropManager.AddDragInitializeHandler(this.border1, OnBorderDrop);
DragDropManager.AddDropHandler(this.border2, OnBorderDrop);
}
private void OnBorderDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
{
MessageBox.Show("Dropped.");
}
private void OnBorderDrop(object sender, DragInitializeEventArgs e)
{
e.AllowedEffects = DragDropEffects.All;
e.DragVisual = new TextBlock() { Text = "Dragging.." };
}
}
}

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

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("CustomArrowCue")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomArrowCue")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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")]

71
DragDrop/CustomArrowCue/Properties/Resources.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CustomArrowCue.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CustomArrowCue.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

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

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

30
DragDrop/CustomArrowCue/Properties/Settings.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CustomArrowCue.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

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

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

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

@ -0,0 +1,5 @@
## Custom Arrow Cue ##
This example demonstrates how to implement a custom drag (arrow) cue that connects the drag origin point with the current mouse position.
<keywords:dragvisual,attached>

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

@ -0,0 +1,9 @@
<Application x:Class="AsyncSqlGeospatialDataReader.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AsyncSqlGeospatialDataReader"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

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

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
namespace AsyncSqlGeospatialDataReader
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

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

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{D3EF7F47-6E0B-4D38-914F-120A7F975715}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>AsyncSqlGeospatialDataReader</RootNamespace>
<AssemblyName>AsyncSqlGeospatialDataReader</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</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</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</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="Telerik.Windows.Controls, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls.DataVisualization, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.DataVisualization.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Data, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Data.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="WktDataStorage.cs" />
<Compile Include="WktItemModel.cs" />
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Resource Include="Readme.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

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

@ -0,0 +1,39 @@
<Window x:Class="AsyncSqlGeospatialDataReader.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
Title="MainWindow" Height="390" Width="620">
<Grid>
<telerik:RadMap Center="33.7861647934865,-84.371616833534"
ZoomLevel="10">
<telerik:RadMap.Provider>
<telerik:OpenStreetMapProvider />
</telerik:RadMap.Provider>
<telerik:VisualizationLayer>
<telerik:VisualizationLayer.ItemTemplate>
<DataTemplate>
<Ellipse Width="10" Height="10" Fill="Red">
<telerik:MapLayer.HotSpot>
<telerik:HotSpot X="0.5" Y="0.5" />
</telerik:MapLayer.HotSpot>
</Ellipse>
</DataTemplate>
</telerik:VisualizationLayer.ItemTemplate>
<telerik:VisualizationLayer.Reader>
<telerik:AsyncSqlGeospatialDataReader x:Name="asyncSqlGeospatialDataReader"
GeospatialPropertyName="Geometry"
ToolTipFormat="Name" />
</telerik:VisualizationLayer.Reader>
<telerik:VisualizationLayer.ShapeFill>
<telerik:MapShapeFill Fill="#7FFFFFFF" Stroke="#5A636B" StrokeThickness="3" />
</telerik:VisualizationLayer.ShapeFill>
<telerik:VisualizationLayer.HighlightFill>
<telerik:MapShapeFill Fill="#B2FFFFFF" Stroke="#5A636B" StrokeThickness="3" />
</telerik:VisualizationLayer.HighlightFill>
</telerik:VisualizationLayer>
</telerik:RadMap>
</Grid>
</Window>

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

@ -0,0 +1,13 @@
using System.Windows;
namespace AsyncSqlGeospatialDataReader
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.asyncSqlGeospatialDataReader.Source = WktDataStorage.GetData();
}
}
}

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

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("AsyncSqlGeospatialDataReader")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AsyncSqlGeospatialDataReader")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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")]

71
Map/WPF/AsyncSqlGeospatialDataReader/Properties/Resources.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AsyncSqlGeospatialDataReader.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AsyncSqlGeospatialDataReader.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

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

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

30
Map/WPF/AsyncSqlGeospatialDataReader/Properties/Settings.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AsyncSqlGeospatialDataReader.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

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

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

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

@ -0,0 +1,5 @@
## AsyncSqlGeospatialDataReader ##
This example shows how to set up a model containing SQL Geospatial data in Wkt format and load it in the RadMap control, using AsyncSqlGeospatialDataReader which enables you to read SQL Geospatial data asynchronously.
<keywords:visualizationlayer, geospatialpropertyname, tooltipformat, mapshapefill, highlightfill, itemtemplate, wkt>

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

@ -0,0 +1,273 @@
using System.Collections.ObjectModel;
namespace AsyncSqlGeospatialDataReader
{
public static class WktDataStorage
{
public static ObservableCollection<WktItemModel> GetData()
{
ObservableCollection<WktItemModel> result = new ObservableCollection<WktItemModel>();
WktItemModel northAreaDataRow = new WktItemModel();
northAreaDataRow.Name = "North Area";
northAreaDataRow.Geometry = "Polygon (("
+ "-84.3932461670301, 33.7967217961125"
+ ", -84.418995373573 33.808989109452"
+ ", -84.4303250244518 33.8377961143588"
+ ", -84.4303250244518 33.8480616114576"
+ ", -84.4320416382213 33.8563301427474"
+ ", -84.4413113525767 33.8668784860621"
+ ", -84.4605374267954 33.8908212383562"
+ ", -84.447147839393 33.8996555568394"
+ ", -84.4169354370492 33.9161818236152"
+ ", -84.384663098182 33.9127628588944"
+ ", -84.3788266113656 33.9133326958734"
+ ", -84.3633770874397 33.9101985453388"
+ ", -84.3616604736702 33.9101985453388"
+ ", -84.3300747803108 33.9204553366171"
+ ", -84.2957425049201 33.9198855472676"
+ ", -84.2596936157599 33.8919612018418"
+ ", -84.2713665893927 33.8831260863279"
+ ", -84.2768597534552 33.8745751033359"
+ ", -84.2905926636114 33.8640277109635"
+ ", -84.3039822510137 33.8480616114574"
+ ", -84.3125653198613 33.8397922798236"
+ ", -84.3489575317754 33.8249625088656"
+ ", -84.3589138916386 33.8226807773054"
+ ", -84.3688702515018 33.8124122318747"
+ ", -84.3822598389041 33.8058511269131"
+ ", -84.3932461670301 33.7967217961125"
+ ", -84.3932461670301 33.7967217961125"
+ "))";
result.Add(northAreaDataRow);
WktItemModel store1DataRow = new WktItemModel();
store1DataRow.Name = "Mr. Dorrell";
store1DataRow.Geometry = "Point (-84.3827345898996 33.858244576749)";
result.Add(store1DataRow);
WktItemModel store2DataRow = new WktItemModel();
store2DataRow.Name = "Family Store";
store2DataRow.Geometry = "Point (-84.3842473557835 33.840489590028)";
result.Add(store2DataRow);
WktItemModel store3DataRow = new WktItemModel();
store3DataRow.Name = "Greenings";
store3DataRow.Geometry = "Point (-84.308161132657 33.8936528837044)";
result.Add(store3DataRow);
WktItemModel store4DataRow = new WktItemModel();
store4DataRow.Name = "Ted's";
store4DataRow.Geometry = "Point (-84.413727515064 33.906362188132)";
result.Add(store4DataRow);
WktItemModel eastAreaDataRow = new WktItemModel();
eastAreaDataRow.Name = "East Area";
eastAreaDataRow.Geometry = "Polygon (("
+ "-84.2596936157599 33.8919612018418"
+ ", -84.2535138061902 33.8825560474539"
+ ", -84.2480206421277 33.8437844708754"
+ ", -84.2562603882215 33.8300961822591"
+ ", -84.2493939331434 33.7913007952029"
+ ", -84.2274212768934 33.7650468834483"
+ ", -84.2301678589246 33.7422108552654"
+ ", -84.2411541870496 33.7159419049292"
+ ", -84.261753552284 33.7182264806728"
+ ", -84.2892193725965 33.7102301996174"
+ ", -84.3249249390027 33.7239376540615"
+ ", -84.3249249390027 33.7399269179405"
+ ", -84.3317913940808 33.7467785474731"
+ ", -84.3523907593152 33.743352801123"
+ ", -84.3743634155652 33.745636647227"
+ ", -84.3935894897839 33.7462075992506"
+ ", -84.3784832886121 33.7593384466376"
+ ", -84.3908429077527 33.7661885251864"
+ ", -84.3904995849988 33.7807431241315"
+ ", -84.3908429077527 33.7901594881121"
+ ", -84.3932461670301 33.7967217961125"
+ ", -84.3822598389041 33.8058511269131"
+ ", -84.3688702515018 33.8124122318747"
+ ", -84.3589138916386 33.8226807773054"
+ ", -84.3489575317754 33.8249625088656"
+ ", -84.3125653198613 33.8397922798236"
+ ", -84.3039822510137 33.8480616114574"
+ ", -84.2905926636114 33.8640277109635"
+ ", -84.2768597534552 33.8745751033359"
+ ", -84.2713665893927 33.8831260863279"
+ ", -84.2596936157599 33.8919612018418"
+ "))";
result.Add(eastAreaDataRow);
store1DataRow = new WktItemModel();
store1DataRow.Name = "Fresh & Green";
store1DataRow.Geometry = "Point (-84.3137723139137 33.815569818206)";
result.Add(store1DataRow);
store2DataRow = new WktItemModel();
store2DataRow.Name = "Dominos";
store2DataRow.Geometry = "Point (-84.3658608129834 33.7727478963652)";
result.Add(store2DataRow);
store3DataRow = new WktItemModel();
store3DataRow.Name = "Ellinor";
store3DataRow.Geometry = "Point (-84.2466419866888 33.7779395401149)";
result.Add(store3DataRow);
store4DataRow = new WktItemModel();
store4DataRow.Name = "NearBy";
store4DataRow.Geometry = "Point (-84.2415028742161 33.7766999578522)";
result.Add(store4DataRow);
WktItemModel store5DataRow = new WktItemModel();
store5DataRow.Name = "Perfecto";
store5DataRow.Geometry = "Point (-84.2783510616587 33.7223916381193)";
result.Add(store5DataRow);
WktItemModel southEastAreaDataRow = new WktItemModel();
southEastAreaDataRow.Name = "South-East Area";
southEastAreaDataRow.Geometry = "Polygon (("
+ "-84.2411541870496 33.7159419049292"
+ ", -84.2562603882214 33.7028044147553"
+ ", -84.2796063354871 33.6970918357038"
+ ", -84.3043255737683 33.6868082362484"
+ ", -84.3208050659558 33.6765234063122"
+ ", -84.367496960487 33.6548069475491"
+ ", -84.3839764526745 33.6342284039869"
+ ", -84.3990826538464 33.6250808058726"
+ ", -84.4869732788464 33.6182194698272"
+ ", -84.4622540405652 33.6307981685331"
+ ", -84.4526410034558 33.6422317554189"
+ ", -84.4389080932996 33.6525206856264"
+ ", -84.4196820190808 33.6673803024105"
+ ", -84.4059491089245 33.6959492743123"
+ ", -84.4059491089245 33.7085166139405"
+ ", -84.3922161987683 33.7210821148631"
+ ", -84.3935894897839 33.7462075992506"
+ ", -84.3743634155652 33.745636647227"
+ ", -84.3523907593152 33.743352801123"
+ ", -84.3317913940808 33.7467785474731"
+ ", -84.3249249390027 33.7399269179405"
+ ", -84.3249249390027 33.7239376540615"
+ ", -84.2892193725965 33.7102301996174"
+ ", -84.261753552284 33.7182264806728"
+ ", -84.2411541870496 33.7159419049292"
+ "))";
result.Add(southEastAreaDataRow);
store1DataRow = new WktItemModel();
store1DataRow.Name = "LollyHolly";
store1DataRow.Geometry = "Point (-84.3795239856981 33.7394093095038)";
result.Add(store1DataRow);
store2DataRow = new WktItemModel();
store2DataRow.Name = "The Favourites";
store2DataRow.Geometry = "Point (-84.3926614454527 33.7063308812285)";
result.Add(store2DataRow);
store3DataRow = new WktItemModel();
store3DataRow.Name = "Quality Food";
store3DataRow.Geometry = "Point (-84.2943745783107 33.6978423497645)";
result.Add(store3DataRow);
store4DataRow = new WktItemModel();
store4DataRow.Name = "Marrie and Jack";
store4DataRow.Geometry = "Point (-84.3917763164772 33.6519384707607)";
result.Add(store4DataRow);
WktItemModel southWestAreaDataRow = new WktItemModel();
southWestAreaDataRow.Name = "South-West Area";
southWestAreaDataRow.Geometry = "Polygon (("
+ "-84.4869732788464 33.6182194698272"
+ ", -84.4979596069714 33.6456615354618"
+ ", -84.4993328979871 33.6753805714828"
+ ", -84.5034527710339 33.6868082362484"
+ ", -84.4965863159558 33.7062317798524"
+ ", -84.5034527710339 33.7233665538214"
+ ", -84.4952130249402 33.7530587270419"
+ ", -84.4938397339246 33.7667593403523"
+ ", -84.4608807495496 33.7530587270419"
+ ", -84.4292950561902 33.7462075992506"
+ ", -84.4169354370495 33.7427818300946"
+ ", -84.3935894897839 33.7462075992506"
+ ", -84.3922161987683 33.7210821148631"
+ ", -84.4059491089245 33.7085166139405"
+ ", -84.4059491089245 33.6959492743123"
+ ", -84.4196820190808 33.6673803024105"
+ ", -84.4389080932996 33.6525206856264"
+ ", -84.4526410034558 33.6422317554189"
+ ", -84.4622540405652 33.6307981685331"
+ ", -84.4869732788464 33.6182194698272"
+ ", -84.4869732788464 33.6182194698272"
+ "))";
result.Add(southWestAreaDataRow);
store1DataRow = new WktItemModel();
store1DataRow.Name = "ShopAtOnes";
store1DataRow.Geometry = "Point (-84.4330930641421 33.7374893033587)";
result.Add(store1DataRow);
store2DataRow = new WktItemModel();
store2DataRow.Name = "GoShopping!";
store2DataRow.Geometry = "Point (-84.4366067579503 33.6845986928175)";
result.Add(store2DataRow);
store3DataRow = new WktItemModel();
store3DataRow.Name = "Variety";
store3DataRow.Geometry = "Point (-84.4933301141971 33.6885377258407)";
result.Add(store3DataRow);
WktItemModel northWestAreaDataRow = new WktItemModel();
northWestAreaDataRow.Name = "North-West Area";
northWestAreaDataRow.Geometry = "Polygon (("
+ "-84.4938397339246 33.7667593403523"
+ ", -84.4965863159558 33.7861647934865"
+ ", -84.4965863159558 33.805565850067"
+ ", -84.4979596069714 33.821539888694"
+ ", -84.4897198608777 33.8272441795402"
+ ", -84.4897198608777 33.8454953528023"
+ ", -84.4828534057996 33.8637426282186"
+ ", -84.4759869507214 33.8728648039164"
+ ", -84.4732403686902 33.8842661526508"
+ ", -84.4622540405652 33.8899662557435"
+ ", -84.4413113525767 33.8668784860621"
+ ", -84.4320416382213 33.8563301427474"
+ ", -84.4303250244518 33.8480616114576"
+ ", -84.4303250244518 33.8377961143588"
+ ", -84.418995373573 33.808989109452"
+ ", -84.3932461670301 33.7967217961125"
+ ", -84.3908429077527 33.7901594881121"
+ ", -84.3904995849988 33.7807431241315"
+ ", -84.3908429077527 33.7661885251864"
+ ", -84.3784832886121 33.7593384466376"
+ ", -84.3935894897839 33.7462075992506"
+ ", -84.4169354370495 33.7427818300946"
+ ", -84.4292950561902 33.7462075992506"
+ ", -84.4608807495496 33.7530587270419"
+ ", -84.4938397339246 33.7667593403523"
+ "))";
result.Add(northWestAreaDataRow);
store1DataRow = new WktItemModel();
store1DataRow.Name = "The Hit";
store1DataRow.Geometry = "Point (-84.3932595780585 33.7492138045389)";
result.Add(store1DataRow);
store2DataRow = new WktItemModel();
store2DataRow.Name = "Mrs. Smith";
store2DataRow.Geometry = "Point (-84.4314542344275 33.7952549107929)";
result.Add(store2DataRow);
store3DataRow = new WktItemModel();
store3DataRow.Name = "Your Store";
store3DataRow.Geometry = "Point (-84.4860425522968 33.8410824657857)";
result.Add(store3DataRow);
return result;
}
}
}

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

@ -0,0 +1,8 @@
namespace AsyncSqlGeospatialDataReader
{
public class WktItemModel
{
public string Name { get; set; }
public string Geometry { get; set; }
}
}

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

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2018
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProvidersBingMapProvider", "ProvidersBingMapProvider\ProvidersBingMapProvider.csproj", "{69BF076F-CEE0-4A7D-96BA-7D2AA43FD82E}"
EndProject
@ -159,6 +159,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualizationLayerShapeSele
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UI_Virtualization_And_Wraparound", "WrapAroundAndVirtualization\UI_Virtualization_And_Wraparound.csproj", "{286A10B1-A8F4-468C-944D-871D8E986E93}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsyncSqlGeospatialDataReader", "AsyncSqlGeospatialDataReader\AsyncSqlGeospatialDataReader.csproj", "{D3EF7F47-6E0B-4D38-914F-120A7F975715}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -477,9 +479,16 @@ Global
{286A10B1-A8F4-468C-944D-871D8E986E93}.Debug|Any CPU.Build.0 = Debug|Any CPU
{286A10B1-A8F4-468C-944D-871D8E986E93}.Release|Any CPU.ActiveCfg = Release|Any CPU
{286A10B1-A8F4-468C-944D-871D8E986E93}.Release|Any CPU.Build.0 = Release|Any CPU
{D3EF7F47-6E0B-4D38-914F-120A7F975715}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3EF7F47-6E0B-4D38-914F-120A7F975715}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3EF7F47-6E0B-4D38-914F-120A7F975715}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3EF7F47-6E0B-4D38-914F-120A7F975715}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7B01C217-4303-4A1D-BB13-023EC0A41457}
EndGlobalSection
EndGlobal

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

@ -1,2 +1,2 @@
## Custom Printing ##
The example demonstrates how to print silently with given printer. When you specify a printer name, the printer with the provided name will print the provided document silently. If the printer with the chosen name is not found, the default printer is being used.
##Custom Printing##
The example demonstrates how to print silently with given printer. When you specify a printer name, the printer with the provided name will print the provided document silently. If the printer with the chosen name is not found, the default printer is being used.