diff --git a/Diagram/HideBezierHandles/App.config b/Diagram/HideBezierHandles/App.config new file mode 100644 index 00000000..8e156463 --- /dev/null +++ b/Diagram/HideBezierHandles/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Diagram/HideBezierHandles/App.xaml b/Diagram/HideBezierHandles/App.xaml new file mode 100644 index 00000000..1b9b47db --- /dev/null +++ b/Diagram/HideBezierHandles/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/Diagram/HideBezierHandles/App.xaml.cs b/Diagram/HideBezierHandles/App.xaml.cs new file mode 100644 index 00000000..6674c4a7 --- /dev/null +++ b/Diagram/HideBezierHandles/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace HideBezierHandles +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/Diagram/HideBezierHandles/App_SL.xaml b/Diagram/HideBezierHandles/App_SL.xaml new file mode 100644 index 00000000..759ae58a --- /dev/null +++ b/Diagram/HideBezierHandles/App_SL.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/Diagram/HideBezierHandles/App_SL.xaml.cs b/Diagram/HideBezierHandles/App_SL.xaml.cs new file mode 100644 index 00000000..7fe48c29 --- /dev/null +++ b/Diagram/HideBezierHandles/App_SL.xaml.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace HideBezierHandles_SL +{ + public partial class App : Application + { + + public App() + { + this.Startup += this.Application_Startup; + this.Exit += this.Application_Exit; + this.UnhandledException += this.Application_UnhandledException; + + InitializeComponent(); + } + + private void Application_Startup(object sender, StartupEventArgs e) + { + this.RootVisual = new MainPage(); + } + + private void Application_Exit(object sender, EventArgs e) + { + + } + + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + // If the app is running outside of the debugger then report the exception using + // the browser's exception mechanism. On IE this will display it a yellow alert + // icon in the status bar and Firefox will display a script error. + if (!System.Diagnostics.Debugger.IsAttached) + { + + // NOTE: This will allow the application to continue running after an exception has been thrown + // but not handled. + // For production applications this error handling should be replaced with something that will + // report the error to the website and stop the application. + e.Handled = true; + Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); + } + } + + private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) + { + try + { + string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; + errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); + + System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); + } + catch (Exception) + { + } + } + } +} diff --git a/Diagram/HideBezierHandles/HideBezierHandles_SL.csproj b/Diagram/HideBezierHandles/HideBezierHandles_SL.csproj new file mode 100644 index 00000000..e2bcca5d --- /dev/null +++ b/Diagram/HideBezierHandles/HideBezierHandles_SL.csproj @@ -0,0 +1,130 @@ + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {178AC78E-336D-4391-8DF7-DDE45BC8B86C} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + HideBezierHandles_SL + HideBezierHandles_SL + Silverlight + v5.0 + $(TargetFrameworkVersion) + true + + + true + true + HideBezierHandles_SL.xap + Properties\AppManifest.xml + HideBezierHandles_SL.App + HideBezierHandles_SLTestPage.html + true + true + false + Properties\OutOfBrowserSettings.xml + false + true + + + + + + + + + + v3.5 + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + + + + + + + $(TargetFrameworkDirectory)System.Core.dll + + + + + + False + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.dll + + + False + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.Diagrams.dll + + + False + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Diagrams.Core.dll + + + + + App_SL.xaml + + + MainPage.xaml + + + + + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Diagram/HideBezierHandles/HideBezierHandles_WPF.csproj b/Diagram/HideBezierHandles/HideBezierHandles_WPF.csproj new file mode 100644 index 00000000..c60174ad --- /dev/null +++ b/Diagram/HideBezierHandles/HideBezierHandles_WPF.csproj @@ -0,0 +1,121 @@ + + + + + Debug + AnyCPU + {9B321CEB-38C4-45FC-81DD-2651F8DA521D} + WinExe + Properties + HideBezierHandles + HideBezierHandles + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + 4.0 + + + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll + + + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Diagrams.dll + + + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Diagrams.Core.dll + + + + + + + + MSBuild:Compile + Designer + + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + \ No newline at end of file diff --git a/Diagram/HideBezierHandles/MainPage.xaml b/Diagram/HideBezierHandles/MainPage.xaml new file mode 100644 index 00000000..a90ed826 --- /dev/null +++ b/Diagram/HideBezierHandles/MainPage.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + diff --git a/Diagram/HideBezierHandles/MainPage.xaml.cs b/Diagram/HideBezierHandles/MainPage.xaml.cs new file mode 100644 index 00000000..39b648d6 --- /dev/null +++ b/Diagram/HideBezierHandles/MainPage.xaml.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace HideBezierHandles_SL +{ + public partial class MainPage : UserControl + { + public MainPage() + { + InitializeComponent(); + } + } +} diff --git a/Diagram/HideBezierHandles/MainWindow.xaml b/Diagram/HideBezierHandles/MainWindow.xaml new file mode 100644 index 00000000..ed614ef6 --- /dev/null +++ b/Diagram/HideBezierHandles/MainWindow.xaml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + diff --git a/Diagram/HideBezierHandles/MainWindow.xaml.cs b/Diagram/HideBezierHandles/MainWindow.xaml.cs new file mode 100644 index 00000000..c97bcea2 --- /dev/null +++ b/Diagram/HideBezierHandles/MainWindow.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace HideBezierHandles +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/Diagram/HideBezierHandles/Properties/AppManifest.xml b/Diagram/HideBezierHandles/Properties/AppManifest.xml new file mode 100644 index 00000000..6712a117 --- /dev/null +++ b/Diagram/HideBezierHandles/Properties/AppManifest.xml @@ -0,0 +1,6 @@ + + + + diff --git a/Diagram/HideBezierHandles/Properties/AssemblyInfo.cs b/Diagram/HideBezierHandles/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..9c42895d --- /dev/null +++ b/Diagram/HideBezierHandles/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HideBezierHandles_SL")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("HideBezierHandles_SL")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[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)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("178ac78e-336d-4391-8df7-dde45bc8b86c")] + +// 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 Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Diagram/HideBezierHandles/Properties/Resources.Designer.cs b/Diagram/HideBezierHandles/Properties/Resources.Designer.cs new file mode 100644 index 00000000..0fa14f96 --- /dev/null +++ b/Diagram/HideBezierHandles/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18051 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HideBezierHandles.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [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("HideBezierHandles.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Diagram/HideBezierHandles/Properties/Resources.resx b/Diagram/HideBezierHandles/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/Diagram/HideBezierHandles/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Diagram/HideBezierHandles/Properties/Settings.Designer.cs b/Diagram/HideBezierHandles/Properties/Settings.Designer.cs new file mode 100644 index 00000000..e908a5ef --- /dev/null +++ b/Diagram/HideBezierHandles/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18051 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HideBezierHandles.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; + } + } + } +} diff --git a/Diagram/HideBezierHandles/Properties/Settings.settings b/Diagram/HideBezierHandles/Properties/Settings.settings new file mode 100644 index 00000000..033d7a5e --- /dev/null +++ b/Diagram/HideBezierHandles/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Diagram/HideBezierHandles/TypeToVisibilityConverter.cs b/Diagram/HideBezierHandles/TypeToVisibilityConverter.cs new file mode 100644 index 00000000..1e66b3c8 --- /dev/null +++ b/Diagram/HideBezierHandles/TypeToVisibilityConverter.cs @@ -0,0 +1,27 @@ +using System; +using System.Windows; +using System.Windows.Data; +using Telerik.Windows.Diagrams.Core; + +namespace HideBezierHandles +{ + public class TypeToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (value != null) + { + var type = (ManipulationPointType)Enum.Parse(typeof(ManipulationPointType), value.ToString(), true); + if (type == ManipulationPointType.BezierStartHandle || type == ManipulationPointType.BezierEndHandle) + return Visibility.Collapsed; + } + + return Visibility.Visible; + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Diagram/HideBezierHandles/readme.txt b/Diagram/HideBezierHandles/readme.txt new file mode 100644 index 00000000..63543e52 --- /dev/null +++ b/Diagram/HideBezierHandles/readme.txt @@ -0,0 +1 @@ +This sample demonstrates how you can hide the bezier handles using two custom styles. \ No newline at end of file