From 5e2a3721f100ad5caff41e60c6769d03357263a5 Mon Sep 17 00:00:00 2001 From: DevExpressExampleBot Date: Mon, 18 Mar 2024 13:05:39 +0400 Subject: [PATCH] autogenerate VB --- VB/App.config | 51 ++++ VB/DXHtmlEditor.sln | 25 ++ VB/DXHtmlEditor.vbproj | 109 ++++++++ VB/DXHtmlEditor/Assets/index.html | 19 ++ VB/DXHtmlEditor/Assets/index.js | 71 ++++++ VB/DXHtmlEditor/Assets/styles.css | 43 ++++ VB/DXHtmlEditor/DXHtmlEditorClient.vb | 225 +++++++++++++++++ VB/DXHtmlEditor/DXHtmlEditorWebView.vb | 145 +++++++++++ VB/DXHtmlEditor/IDXHtmlEditorAPI.vb | 10 + VB/MainForm.Designer.vb | 335 +++++++++++++++++++++++++ VB/MainForm.resx | 173 +++++++++++++ VB/MainForm.vb | 73 ++++++ VB/Program.vb | 18 ++ VB/Properties/AssemblyInfo.vb | 32 +++ VB/Properties/Resources.Designer.vb | 62 +++++ VB/Properties/Resources.resx | 117 +++++++++ VB/Properties/Settings.Designer.vb | 25 ++ VB/Properties/Settings.settings | 7 + 18 files changed, 1540 insertions(+) create mode 100644 VB/App.config create mode 100644 VB/DXHtmlEditor.sln create mode 100644 VB/DXHtmlEditor.vbproj create mode 100644 VB/DXHtmlEditor/Assets/index.html create mode 100644 VB/DXHtmlEditor/Assets/index.js create mode 100644 VB/DXHtmlEditor/Assets/styles.css create mode 100644 VB/DXHtmlEditor/DXHtmlEditorClient.vb create mode 100644 VB/DXHtmlEditor/DXHtmlEditorWebView.vb create mode 100644 VB/DXHtmlEditor/IDXHtmlEditorAPI.vb create mode 100644 VB/MainForm.Designer.vb create mode 100644 VB/MainForm.resx create mode 100644 VB/MainForm.vb create mode 100644 VB/Program.vb create mode 100644 VB/Properties/AssemblyInfo.vb create mode 100644 VB/Properties/Resources.Designer.vb create mode 100644 VB/Properties/Resources.resx create mode 100644 VB/Properties/Settings.Designer.vb create mode 100644 VB/Properties/Settings.settings diff --git a/VB/App.config b/VB/App.config new file mode 100644 index 0000000..0bd14dd --- /dev/null +++ b/VB/App.config @@ -0,0 +1,51 @@ + + + + +
+ + + + + + Skin/WXI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PerMonitorV2 + + + + + + + + + + \ No newline at end of file diff --git a/VB/DXHtmlEditor.sln b/VB/DXHtmlEditor.sln new file mode 100644 index 0000000..dc88acc --- /dev/null +++ b/VB/DXHtmlEditor.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34511.84 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DXHtmlEditor", "DXHtmlEditor.vbproj", "{2A9B94DA-5442-43D0-A6A7-17C724D1E947}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2A9B94DA-5442-43D0-A6A7-17C724D1E947}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A9B94DA-5442-43D0-A6A7-17C724D1E947}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A9B94DA-5442-43D0-A6A7-17C724D1E947}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A9B94DA-5442-43D0-A6A7-17C724D1E947}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BFB39E5B-0BE8-416E-A378-3E2C5BB1EE0C} + EndGlobalSection +EndGlobal diff --git a/VB/DXHtmlEditor.vbproj b/VB/DXHtmlEditor.vbproj new file mode 100644 index 0000000..fc4b4cb --- /dev/null +++ b/VB/DXHtmlEditor.vbproj @@ -0,0 +1,109 @@ + + + + + On + Debug + AnyCPU + {2A9B94DA-5442-43D0-A6A7-17C724D1E947} + WinExe + + + DXHtmlEditor + v4.8 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG,TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + Component + + + + Form + + + MainForm.vb + + + + + MainForm.vb + + + ResXFileCodeGenerator + Resources.Designer.vb + Designer + DXHtmlEditor.Properties + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.vb + + + True + Settings.settings + True + + + + + + + + + + + + + 1.0.2277.86 + + + + \ No newline at end of file diff --git a/VB/DXHtmlEditor/Assets/index.html b/VB/DXHtmlEditor/Assets/index.html new file mode 100644 index 0000000..672ad21 --- /dev/null +++ b/VB/DXHtmlEditor/Assets/index.html @@ -0,0 +1,19 @@ + + + + DevExtreme Demo + + + + + + + + + + + + +
+ + diff --git a/VB/DXHtmlEditor/Assets/index.js b/VB/DXHtmlEditor/Assets/index.js new file mode 100644 index 0000000..c08c712 --- /dev/null +++ b/VB/DXHtmlEditor/Assets/index.js @@ -0,0 +1,71 @@ +$(() => { + htmlEditor = $('.html-editor').dxHtmlEditor({ + height: '100vh', + //value: markup, + imageUpload: { + tabs: ['file', 'url'], + fileUploadMode: 'base64', + }, + toolbar: { + items: [ + 'undo', 'redo', 'separator', + { + name: 'size', + acceptedValues: ['8pt', '10pt', '12pt', '14pt', '18pt', '24pt', '36pt'], + options: { inputAttr: { 'aria-label': 'Font size' } }, + }, + { + name: 'font', + acceptedValues: ['Arial', 'Courier New', 'Georgia', 'Impact', 'Lucida Console', 'Tahoma', 'Times New Roman', 'Verdana'], + options: { inputAttr: { 'aria-label': 'Font family' } }, + }, + 'separator', 'bold', 'italic', 'strike', 'underline', 'separator', + 'alignLeft', 'alignCenter', 'alignRight', 'alignJustify', 'separator', + 'orderedList', 'bulletList', 'separator', + { + name: 'header', + acceptedValues: [false, 1, 2, 3, 4, 5], + options: { inputAttr: { 'aria-label': 'Header' } }, + }, 'separator', + 'color', 'background', 'separator', + 'link', 'image', 'separator', + 'clear', 'codeBlock', 'blockquote', 'separator', + 'insertTable', 'deleteTable', + 'insertRowAbove', 'insertRowBelow', 'deleteRow', + 'insertColumnLeft', 'insertColumnRight', 'deleteColumn', + ], + }, + mediaResizing: { + enabled: true, + }, + onInitialized: function (e) { + window.chrome.webview.postMessage("Loaded"); + }, + onValueChanged: function (e) { + window.chrome.webview.postMessage("HtmlChanged"); + } + }).dxHtmlEditor('instance'); +}); +function getHtmlBase64() { + const base64 = htmlEditor.getQuillInstance().getSemanticHTML(); + return utf8_to_b64(base64); +} +function setHtmlFromBase64(htmlBase64) { + const html = b64_to_utf8(htmlBase64); + htmlEditor.getQuillInstance().clipboard.dangerouslyPasteHTML(html); +} +function undo() { + // https://js.devexpress.com/jQuery/Documentation/ApiReference/UI_Components/dxHtmlEditor/Methods/#undo + htmlEditor.undo(); +} +function redo() { + // https://js.devexpress.com/jQuery/Documentation/ApiReference/UI_Components/dxHtmlEditor/Methods/#redo + htmlEditor.redo(); +} +//https://developer.mozilla.org/en-US/docs/Web/API/btoa#unicode_strings +function utf8_to_b64(str) { + return window.btoa(unescape(encodeURIComponent(str))); +} +function b64_to_utf8(str) { + return decodeURIComponent(escape(window.atob(str))); +} diff --git a/VB/DXHtmlEditor/Assets/styles.css b/VB/DXHtmlEditor/Assets/styles.css new file mode 100644 index 0000000..b1a2593 --- /dev/null +++ b/VB/DXHtmlEditor/Assets/styles.css @@ -0,0 +1,43 @@ +.dx-htmleditor-content img { + vertical-align: middle; + padding-right: 10px; +} + +body, html { + margin: 0; + padding: 0; +} + +* { + box-sizing: border-box; +} + +.dx-htmleditor-content table { + width: 100%; +} + +/* initial margin */ +body.dx-view-port { + padding: unset; +} + +/* initial border */ +.dx-htmleditor.dx-htmleditor-outlined { + box-shadow: unset; +} + +/* border when the component is active or focused */ +.dx-htmleditor.dx-htmleditor-outlined.dx-state-active, .dx-htmleditor.dx-htmleditor-outlined.dx-state-focused { + box-shadow: unset; + border-color: unset; +} + +/* main border */ +.dx-htmleditor { + border: unset; +} + + /* 1px border between toolbar and content */ +.dx-htmleditor .dx-htmleditor-toolbar-wrapper:first-child { + border-bottom: unset; +} \ No newline at end of file diff --git a/VB/DXHtmlEditor/DXHtmlEditorClient.vb b/VB/DXHtmlEditor/DXHtmlEditorClient.vb new file mode 100644 index 0000000..d7f2947 --- /dev/null +++ b/VB/DXHtmlEditor/DXHtmlEditorClient.vb @@ -0,0 +1,225 @@ +Imports System +Imports System.IO +Imports System.Text +Imports System.Threading.Tasks +Imports Microsoft.Web.WebView2.Core +Imports System.Runtime.InteropServices + +Namespace DXHtmlEditor + + Friend NotInheritable Class DXHtmlEditorClient + Implements IDisposable + + Const rootURI As String = "https://htmleditor/index.html" + + Const rootURIFilter As String = "https://htmleditor/*" + + Const ThemeNameReplace As String = "$ThemeName$" + + Const WebMessage_HtmlChanged As String = """HtmlChanged""" + + Const WebMessage_Loaded As String = """Loaded""" + + Private ReadOnly editorAPI As IDXHtmlEditorAPI + + Private themeNameField As String = "dx.light.css" + + Private webView As CoreWebView2 + + Public Sub New(ByVal editorAPI As IDXHtmlEditorAPI) + Me.editorAPI = editorAPI + End Sub + + Public Sub Dispose() Implements IDisposable.Dispose + ReleaseWebView() + End Sub + + Public Property ThemeName As String + Get + Return themeNameField + End Get + + Set(ByVal value As String) + If Equals(themeNameField, value) Then Return + themeNameField = value + webView?.Reload() + End Set + End Property + + Private Async Function CallDxHtmlEditClient(ByVal method As String) As Task(Of String) + Dim result As String = Await webView?.ExecuteScriptAsync($"{method}") + If Not String.IsNullOrEmpty(result) AndAlso result.Length > 3 AndAlso result(0) = """"c AndAlso result(result.Length - 1) = """"c Then Return result.Substring(1, result.Length - 2) + Return result + End Function + + Private Sub OnWebMessageReceived(ByVal sender As Object, ByVal e As CoreWebView2WebMessageReceivedEventArgs) + If Equals(e.WebMessageAsJson, WebMessage_Loaded) Then editorAPI?.RaiseOnLoaded() + If Equals(e.WebMessageAsJson, WebMessage_HtmlChanged) Then editorAPI.RaiseOnHtmlChanged() + End Sub + + Private Sub OnWebResourceRequested(ByVal sender As Object, ByVal e As CoreWebView2WebResourceRequestedEventArgs) + Dim environment = webView?.Environment + If environment Is Nothing Then Return + Dim asset As String = $"{NameOf(DXHtmlEditor)}.{NameOf(DXHtmlEditor)}.Assets.{e.Request.Uri.Substring(rootURIFilter.Length - 1)}" + Dim allowSetTheme As Boolean = Nothing + Try + Dim resourceStream As Stream = GetType(DXHtmlEditorClient).Assembly.GetManifestResourceStream(asset) + If resourceStream Is Nothing Then + e.Response = NotFoundResponse(environment) + Return + End If + + Dim headers As String = GetHeaders(asset, allowSetTheme) + Dim content As Stream = If(allowSetTheme, GetContent(resourceStream, ThemeName), resourceStream) + e.Response = ContentResponse(environment, headers, content) + Catch + e.Response = NotFoundResponse(environment) + End Try + End Sub + + Private Sub ReleaseWebView() + If webView IsNot Nothing Then + RemoveHandler webView.WebResourceRequested, AddressOf OnWebResourceRequested + RemoveHandler webView.WebMessageReceived, AddressOf OnWebMessageReceived + webView = Nothing + End If + End Sub + + Public Sub Initialize(ByVal webView As CoreWebView2) + ReleaseWebView() + Me.webView = webView + If webView IsNot Nothing Then + webView.Settings.AreDefaultScriptDialogsEnabled = True + webView.Settings.IsScriptEnabled = True +#If Not DEBUG + webView.Settings.AreDevToolsEnabled = false; +#End If + AddHandler webView.WebResourceRequested, AddressOf OnWebResourceRequested + AddHandler webView.WebMessageReceived, AddressOf OnWebMessageReceived + webView.AddWebResourceRequestedFilter(rootURIFilter, CoreWebView2WebResourceContext.All) + webView.Navigate(rootURI) + End If + End Sub + + Public Async Function GetHtmlText() As Task(Of String) + Dim base64String As String = Await CallDxHtmlEditClient("getHtmlBase64()") + Return Encoding.UTF8.GetString(Convert.FromBase64String(base64String)) + End Function + + Public Async Function SetHtmlText(ByVal htmlString As String) As Task(Of String) + Dim base64String As String = Convert.ToBase64String(Encoding.UTF8.GetBytes(htmlString)) + Return Await CallDxHtmlEditClient($"setHtmlFromBase64(""{base64String}"")") + End Function + + Public Async Function Undo() As Task + Await CallDxHtmlEditClient("undo()") + End Function + + Public Async Function Redo() As Task + Await CallDxHtmlEditClient("redo()") + End Function + +#Region "Utils" + Private Shared Function ContentResponse(ByVal environment As CoreWebView2Environment, ByVal headers As String, ByVal content As Stream) As CoreWebView2WebResourceResponse + Return environment.CreateWebResourceResponse(New ReadOnlyStream(content), 200, "OK", headers) + End Function + + Private Shared Function NotFoundResponse(ByVal environment As CoreWebView2Environment) As CoreWebView2WebResourceResponse + Return environment.CreateWebResourceResponse(Nothing, 404, "Not found", String.Empty) + End Function + + Private Shared Function GetHeaders(ByVal asset As String, ByRef allowSetTheme As Boolean) As String + allowSetTheme = False + If asset.EndsWith(".html", StringComparison.OrdinalIgnoreCase) Then + allowSetTheme = True + Return "Content-Type: text/html" + ElseIf asset.EndsWith(".css", StringComparison.OrdinalIgnoreCase) Then + Return "Content-type: text/css" + ElseIf asset.EndsWith(".js", StringComparison.OrdinalIgnoreCase) Then + Return "Content-Type: application/javascript" + End If + + Return String.Empty + End Function + + Private Shared Function GetContent(ByVal resourceStream As Stream, ByVal theme As String) As Stream + Using reader = New StreamReader(resourceStream) + Dim content As String = reader.ReadToEnd().Replace(ThemeNameReplace, theme) + resourceStream.Dispose() + Return New MemoryStream(Encoding.UTF8.GetBytes(content)) + End Using + End Function + + Private NotInheritable Class ReadOnlyStream + Inherits Stream + + Private ReadOnly resource As Stream + + Public Sub New(ByVal source As Stream) + resource = source + End Sub + + Public Overrides ReadOnly Property CanRead As Boolean + Get + Return resource.CanRead + End Get + End Property + + Public Overrides ReadOnly Property CanSeek As Boolean + Get + Return resource.CanSeek + End Get + End Property + + Public Overrides ReadOnly Property CanWrite As Boolean + Get + Return False + End Get + End Property + + Public Overrides ReadOnly Property Length As Long + Get + Return resource.Length + End Get + End Property + + Public Overrides Property Position As Long + Get + Return resource.Position + End Get + + Set(ByVal value As Long) + resource.Position = value + End Set + End Property + + Public Overrides Function Read(ByVal buffer As Byte(), ByVal offset As Integer, ByVal count As Integer) As Integer + Try + Dim lRead As Integer = resource.Read(buffer, offset, count) + If lRead = 0 Then resource.Dispose() + Return lRead + Catch + resource.Dispose() + Throw + End Try + End Function + + Public Overrides Function Seek(ByVal offset As Long, ByVal origin As SeekOrigin) As Long + Return resource.Seek(offset, origin) + End Function + + Public Overrides Sub SetLength(ByVal value As Long) + Throw New NotSupportedException() + End Sub + + Public Overrides Sub Write(ByVal buffer As Byte(), ByVal offset As Integer, ByVal count As Integer) + Throw New NotSupportedException() + End Sub + + Public Overrides Sub Flush() + Throw New NotSupportedException() + End Sub + End Class +#End Region ' Utils + End Class +End Namespace diff --git a/VB/DXHtmlEditor/DXHtmlEditorWebView.vb b/VB/DXHtmlEditor/DXHtmlEditorWebView.vb new file mode 100644 index 0000000..63e803e --- /dev/null +++ b/VB/DXHtmlEditor/DXHtmlEditorWebView.vb @@ -0,0 +1,145 @@ +Imports System +Imports System.Threading.Tasks +Imports DevExpress.Utils +Imports Microsoft.Web.WebView2.Core +Imports Microsoft.Web.WebView2.WinForms + +Namespace DXHtmlEditor + + Public Class DXHtmlEditorWebView + Inherits WebView2 + Implements IDXHtmlEditorAPI + + Private client As DXHtmlEditorClient + + Public Sub New() + If Not DesignMode Then Initialize() + End Sub + +#Region "API" + Public Async Function GetHtmlText() As Task(Of String) + Await EnsureIsLoaded() + Return Await client.GetHtmlText() + End Function + + Public Async Function SetHtmlText(ByVal htmlString As String) As Task(Of String) + Await EnsureIsLoaded() + Return Await client.SetHtmlText(htmlString) + End Function + + Public Function CanSetTheme(ByVal themeName As String) As Boolean + Return Not Equals(client.ThemeName, themeName) + End Function + + Public Async Function SetTheme(ByVal themeName As String) As Task + Dim htmlText As String = Await GetHtmlText() + StartLoading() + client.ThemeName = themeName + Await SetHtmlText(htmlText) + Refresh() + End Function + +#End Region ' API +#Region "Custom API Sample" + Public Async Function Undo() As Task + Await EnsureIsLoaded() + Await client.Undo() + End Function + + Public Async Function Redo() As Task + Await EnsureIsLoaded() + Await client.Redo() + End Function + +#End Region +#Region "Events" + Private Shared ReadOnly htmlChangedField As Object = New Object() + + Private Shared ReadOnly htmlLoadedField As Object = New Object() + + ' + Public Custom Event HtmlChanged As EventHandler + AddHandler(ByVal value As EventHandler) + Events.AddHandler(htmlChangedField, value) + End AddHandler + + RemoveHandler(ByVal value As EventHandler) + Events.RemoveHandler(htmlChangedField, value) + End RemoveHandler + + RaiseEvent(ByVal sender As Object, ByVal e As EventArgs) + End RaiseEvent + End Event + + Public Custom Event HtmlLoaded As EventHandler + AddHandler(ByVal value As EventHandler) + Events.AddHandler(htmlLoadedField, value) + End AddHandler + + RemoveHandler(ByVal value As EventHandler) + Events.RemoveHandler(htmlLoadedField, value) + End RemoveHandler + + RaiseEvent(ByVal sender As Object, ByVal e As EventArgs) + End RaiseEvent + End Event + + Private Sub RaiseOnHtmlChanged() Implements IDXHtmlEditorAPI.RaiseOnHtmlChanged + TryCast(Events(htmlChangedField), EventHandler)?.Invoke(Me, EventArgs.Empty) + End Sub + + Private Sub RaiseOnLoaded() Implements IDXHtmlEditorAPI.RaiseOnLoaded + loadedSource?.TrySetResult(True) + TryCast(Events(htmlLoadedField), EventHandler)?.Invoke(Me, EventArgs.Empty) + End Sub + +#End Region ' Events +#Region "Internal" + Private Sub Initialize() + StartLoading() + client = New DXHtmlEditorClient(Me) + AddHandler CoreWebView2InitializationCompleted, AddressOf OnCoreWebView2InitializationCompleted + End Sub + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + RemoveHandler CoreWebView2InitializationCompleted, AddressOf OnCoreWebView2InitializationCompleted + loadedSource?.TrySetCanceled() + loadedSource = Nothing + DisposeHelper.Dispose(client) + MyBase.Dispose(disposing) + End Sub + + Protected Overrides Sub OnHandleCreated(ByVal e As EventArgs) + MyBase.OnHandleCreated(e) + If Not DesignMode Then EnsureCoreWebView2Async() + End Sub + + Protected Overrides Sub OnHandleDestroyed(ByVal e As EventArgs) + MyBase.OnHandleDestroyed(e) + loadedSource?.TrySetCanceled() + End Sub + + Private Sub OnCoreWebView2InitializationCompleted(ByVal sender As Object, ByVal e As CoreWebView2InitializationCompletedEventArgs) + client.Initialize(CoreWebView2) + End Sub + + Private loadedSource As TaskCompletionSource(Of Boolean) + + Private Sub StartLoading() + Dim prevSource = loadedSource + loadedSource = New TaskCompletionSource(Of Boolean)(TaskCreationOptions.RunContinuationsAsynchronously) + If prevSource IsNot Nothing AndAlso Not prevSource.Task.IsCompleted Then prevSource.TrySetCanceled() + End Sub + + Private Async Function EnsureIsLoaded() As Task + Try + Dim loadingTask As Task(Of Boolean) = loadedSource?.Task + Dim loaded As Boolean = Await loadingTask + If Not loaded OrElse loadingTask.IsFaulted Then Throw New Exception("DXHtmlEditor loading failed", loadingTask?.Exception) + Catch e As TaskCanceledException + If e.Task IsNot loadedSource?.Task Then Await EnsureIsLoaded() + End Try + End Function +#End Region + End Class +End Namespace diff --git a/VB/DXHtmlEditor/IDXHtmlEditorAPI.vb b/VB/DXHtmlEditor/IDXHtmlEditorAPI.vb new file mode 100644 index 0000000..538908e --- /dev/null +++ b/VB/DXHtmlEditor/IDXHtmlEditorAPI.vb @@ -0,0 +1,10 @@ +Namespace DXHtmlEditor + + Friend Interface IDXHtmlEditorAPI + + Sub RaiseOnHtmlChanged() + + Sub RaiseOnLoaded() + + End Interface +End Namespace diff --git a/VB/MainForm.Designer.vb b/VB/MainForm.Designer.vb new file mode 100644 index 0000000..6fa6ed8 --- /dev/null +++ b/VB/MainForm.Designer.vb @@ -0,0 +1,335 @@ +Namespace DXHtmlEditor + + Partial Class MainForm + + ''' + ''' Required designer variable. + ''' + Private components As System.ComponentModel.IContainer = Nothing + + ''' + ''' Clean up any resources being used. + ''' + ''' true if managed resources should be disposed; otherwise, false. + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso (Me.components IsNot Nothing) Then + Me.components.Dispose() + End If + + MyBase.Dispose(disposing) + End Sub + +#Region "Windows Form Designer generated code" + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(DXHtmlEditor.MainForm)) + Me.ribbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl() + Me.skinDropDownButtonItem1 = New DevExpress.XtraBars.SkinDropDownButtonItem() + Me.skinPaletteRibbonGalleryBarItem1 = New DevExpress.XtraBars.SkinPaletteRibbonGalleryBarItem() + Me.bbiUndo = New DevExpress.XtraBars.BarButtonItem() + Me.bbiRedo = New DevExpress.XtraBars.BarButtonItem() + Me.ribbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() + Me.ribbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.ribbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.ribbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage() + Me.layoutControl = New DevExpress.XtraLayout.LayoutControl() + Me.panelControl1 = New DevExpress.XtraEditors.PanelControl() + Me.dxHtmlEditorWebView = New DXHtmlEditor.DXHtmlEditorWebView() + Me.targetMemoEdit = New DevExpress.XtraEditors.MemoEdit() + Me.sourceMemoEdit = New DevExpress.XtraEditors.MemoEdit() + Me.layoutControlGroup1 = New DevExpress.XtraLayout.LayoutControlGroup() + Me.tabbedControlGroup1 = New DevExpress.XtraLayout.TabbedControlGroup() + Me.layoutControlGroup2 = New DevExpress.XtraLayout.LayoutControlGroup() + Me.layoutControlItem4 = New DevExpress.XtraLayout.LayoutControlItem() + Me.layoutControlGroup3 = New DevExpress.XtraLayout.LayoutControlGroup() + Me.layoutControlItem1 = New DevExpress.XtraLayout.LayoutControlItem() + Me.layoutControlGroup4 = New DevExpress.XtraLayout.LayoutControlGroup() + Me.layoutControlItem2 = New DevExpress.XtraLayout.LayoutControlItem() + CType((Me.ribbonControl1), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.layoutControl), System.ComponentModel.ISupportInitialize).BeginInit() + Me.layoutControl.SuspendLayout() + CType((Me.panelControl1), System.ComponentModel.ISupportInitialize).BeginInit() + Me.panelControl1.SuspendLayout() + CType((Me.dxHtmlEditorWebView), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.targetMemoEdit.Properties), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.sourceMemoEdit.Properties), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.layoutControlGroup1), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.tabbedControlGroup1), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.layoutControlGroup2), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.layoutControlItem4), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.layoutControlGroup3), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.layoutControlItem1), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.layoutControlGroup4), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.layoutControlItem2), System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + ' ribbonControl1 + ' + Me.ribbonControl1.ExpandCollapseItem.Id = 0 + Me.ribbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.ribbonControl1.ExpandCollapseItem, Me.skinDropDownButtonItem1, Me.skinPaletteRibbonGalleryBarItem1, Me.bbiUndo, Me.bbiRedo}) + Me.ribbonControl1.Location = New System.Drawing.Point(0, 0) + Me.ribbonControl1.MaxItemId = 6 + Me.ribbonControl1.Name = "ribbonControl1" + Me.ribbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.ribbonPage1}) + Me.ribbonControl1.Size = New System.Drawing.Size(848, 201) + ' + ' skinDropDownButtonItem1 + ' + Me.skinDropDownButtonItem1.Id = 1 + Me.skinDropDownButtonItem1.Name = "skinDropDownButtonItem1" + ' + ' skinPaletteRibbonGalleryBarItem1 + ' + Me.skinPaletteRibbonGalleryBarItem1.Caption = "skinPaletteRibbonGalleryBarItem1" + Me.skinPaletteRibbonGalleryBarItem1.Id = 3 + Me.skinPaletteRibbonGalleryBarItem1.Name = "skinPaletteRibbonGalleryBarItem1" + ' + ' bbiUndo + ' + Me.bbiUndo.Caption = "Undo" + Me.bbiUndo.Id = 4 + Me.bbiUndo.ImageOptions.SvgImage = CType((resources.GetObject("bbiUndo.ImageOptions.SvgImage")), DevExpress.Utils.Svg.SvgImage) + Me.bbiUndo.Name = "bbiUndo" + AddHandler Me.bbiUndo.ItemClick, New DevExpress.XtraBars.ItemClickEventHandler(AddressOf Me.OnUndo) + ' + ' bbiRedo + ' + Me.bbiRedo.Caption = "Redo" + Me.bbiRedo.Id = 5 + Me.bbiRedo.ImageOptions.SvgImage = CType((resources.GetObject("bbiRedo.ImageOptions.SvgImage")), DevExpress.Utils.Svg.SvgImage) + Me.bbiRedo.Name = "bbiRedo" + AddHandler Me.bbiRedo.ItemClick, New DevExpress.XtraBars.ItemClickEventHandler(AddressOf Me.OnRedo) + ' + ' ribbonPage1 + ' + Me.ribbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.ribbonPageGroup2, Me.ribbonPageGroup1}) + Me.ribbonPage1.Name = "ribbonPage1" + Me.ribbonPage1.Text = "View" + ' + ' ribbonPageGroup2 + ' + Me.ribbonPageGroup2.ItemLinks.Add(Me.bbiUndo) + Me.ribbonPageGroup2.ItemLinks.Add(Me.bbiRedo) + Me.ribbonPageGroup2.Name = "ribbonPageGroup2" + Me.ribbonPageGroup2.Text = "Edit" + ' + ' ribbonPageGroup1 + ' + Me.ribbonPageGroup1.ItemLinks.Add(Me.skinDropDownButtonItem1) + Me.ribbonPageGroup1.ItemLinks.Add(Me.skinPaletteRibbonGalleryBarItem1) + Me.ribbonPageGroup1.Name = "ribbonPageGroup1" + Me.ribbonPageGroup1.Text = "Appearance" + ' + ' ribbonPage2 + ' + Me.ribbonPage2.Name = "ribbonPage2" + Me.ribbonPage2.Text = "ribbonPage2" + ' + ' layoutControl + ' + Me.layoutControl.AllowCustomization = False + Me.layoutControl.Controls.Add(Me.panelControl1) + Me.layoutControl.Controls.Add(Me.targetMemoEdit) + Me.layoutControl.Controls.Add(Me.sourceMemoEdit) + Me.layoutControl.Dock = System.Windows.Forms.DockStyle.Fill + Me.layoutControl.Location = New System.Drawing.Point(0, 201) + Me.layoutControl.Name = "layoutControl" + Me.layoutControl.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = New System.Drawing.Rectangle(2455, 1009, 975, 877) + Me.layoutControl.Root = Me.layoutControlGroup1 + Me.layoutControl.Size = New System.Drawing.Size(848, 448) + Me.layoutControl.TabIndex = 2 + ' + ' panelControl1 + ' + Me.panelControl1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple + Me.panelControl1.Controls.Add(Me.dxHtmlEditorWebView) + Me.panelControl1.Location = New System.Drawing.Point(32, 61) + Me.panelControl1.Name = "panelControl1" + Me.panelControl1.Size = New System.Drawing.Size(784, 355) + Me.panelControl1.TabIndex = 7 + ' + ' dxHtmlEditorWebView + ' + Me.dxHtmlEditorWebView.AllowExternalDrop = True + Me.dxHtmlEditorWebView.CreationProperties = Nothing + Me.dxHtmlEditorWebView.DefaultBackgroundColor = System.Drawing.Color.White + Me.dxHtmlEditorWebView.Dock = System.Windows.Forms.DockStyle.Fill + Me.dxHtmlEditorWebView.Location = New System.Drawing.Point(2, 2) + Me.dxHtmlEditorWebView.Name = "dxHtmlEditorWebView" + Me.dxHtmlEditorWebView.Size = New System.Drawing.Size(780, 351) + Me.dxHtmlEditorWebView.TabIndex = 6 + Me.dxHtmlEditorWebView.ZoomFactor = 1R + ' + ' targetMemoEdit + ' + Me.targetMemoEdit.Location = New System.Drawing.Point(32, 61) + Me.targetMemoEdit.MenuManager = Me.ribbonControl1 + Me.targetMemoEdit.Name = "targetMemoEdit" + Me.targetMemoEdit.Properties.[ReadOnly] = True + Me.targetMemoEdit.Size = New System.Drawing.Size(784, 355) + Me.targetMemoEdit.StyleController = Me.layoutControl + Me.targetMemoEdit.TabIndex = 5 + ' + ' sourceMemoEdit + ' + Me.sourceMemoEdit.Location = New System.Drawing.Point(32, 61) + Me.sourceMemoEdit.MenuManager = Me.ribbonControl1 + Me.sourceMemoEdit.Name = "sourceMemoEdit" + Me.sourceMemoEdit.Size = New System.Drawing.Size(784, 355) + Me.sourceMemoEdit.StyleController = Me.layoutControl + Me.sourceMemoEdit.TabIndex = 4 + AddHandler Me.sourceMemoEdit.TextChanged, New System.EventHandler(AddressOf Me.OnSourceMemoEditTextChanged) + ' + ' layoutControlGroup1 + ' + Me.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True] + Me.layoutControlGroup1.GroupBordersVisible = False + Me.layoutControlGroup1.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.tabbedControlGroup1}) + Me.layoutControlGroup1.Name = "Root" + Me.layoutControlGroup1.Size = New System.Drawing.Size(848, 448) + Me.layoutControlGroup1.TextVisible = False + ' + ' tabbedControlGroup1 + ' + Me.tabbedControlGroup1.Location = New System.Drawing.Point(0, 0) + Me.tabbedControlGroup1.Name = "tabbedControlGroup1" + Me.tabbedControlGroup1.SelectedTabPage = Me.layoutControlGroup2 + Me.tabbedControlGroup1.Size = New System.Drawing.Size(822, 422) + Me.tabbedControlGroup1.TabPages.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.layoutControlGroup2, Me.layoutControlGroup3, Me.layoutControlGroup4}) + ' + ' layoutControlGroup2 + ' + Me.layoutControlGroup2.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.layoutControlItem4}) + Me.layoutControlGroup2.Location = New System.Drawing.Point(0, 0) + Me.layoutControlGroup2.Name = "layoutControlGroup2" + Me.layoutControlGroup2.Size = New System.Drawing.Size(790, 361) + Me.layoutControlGroup2.Text = "HTML Editor" + ' + ' layoutControlItem4 + ' + Me.layoutControlItem4.Control = Me.panelControl1 + Me.layoutControlItem4.Location = New System.Drawing.Point(0, 0) + Me.layoutControlItem4.Name = "layoutControlItem4" + Me.layoutControlItem4.Size = New System.Drawing.Size(790, 361) + Me.layoutControlItem4.Text = "Edit Html" + Me.layoutControlItem4.TextSize = New System.Drawing.Size(0, 0) + Me.layoutControlItem4.TextVisible = False + ' + ' layoutControlGroup3 + ' + Me.layoutControlGroup3.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.layoutControlItem1}) + Me.layoutControlGroup3.Location = New System.Drawing.Point(0, 0) + Me.layoutControlGroup3.Name = "layoutControlGroup3" + Me.layoutControlGroup3.Size = New System.Drawing.Size(790, 361) + Me.layoutControlGroup3.Text = "Plain Text Editor" + ' + ' layoutControlItem1 + ' + Me.layoutControlItem1.Control = Me.sourceMemoEdit + Me.layoutControlItem1.Location = New System.Drawing.Point(0, 0) + Me.layoutControlItem1.Name = "layoutControlItem1" + Me.layoutControlItem1.Size = New System.Drawing.Size(790, 361) + Me.layoutControlItem1.Text = "Set Html Text" + Me.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top + Me.layoutControlItem1.TextSize = New System.Drawing.Size(0, 0) + Me.layoutControlItem1.TextVisible = False + ' + ' layoutControlGroup4 + ' + Me.layoutControlGroup4.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.layoutControlItem2}) + Me.layoutControlGroup4.Location = New System.Drawing.Point(0, 0) + Me.layoutControlGroup4.Name = "layoutControlGroup4" + Me.layoutControlGroup4.Size = New System.Drawing.Size(790, 361) + Me.layoutControlGroup4.Text = "Html Text" + ' + ' layoutControlItem2 + ' + Me.layoutControlItem2.Control = Me.targetMemoEdit + Me.layoutControlItem2.Location = New System.Drawing.Point(0, 0) + Me.layoutControlItem2.Name = "layoutControlItem2" + Me.layoutControlItem2.Size = New System.Drawing.Size(790, 361) + Me.layoutControlItem2.Text = "Get Html Text" + Me.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top + Me.layoutControlItem2.TextSize = New System.Drawing.Size(0, 0) + Me.layoutControlItem2.TextVisible = False + ' + ' MainForm + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(848, 649) + Me.Controls.Add(Me.layoutControl) + Me.Controls.Add(Me.ribbonControl1) + Me.IconOptions.SvgImage = CType((resources.GetObject("MainForm.IconOptions.SvgImage")), DevExpress.Utils.Svg.SvgImage) + Me.Name = "MainForm" + Me.Ribbon = Me.ribbonControl1 + Me.Text = "DXHtmlEditor Sample" + CType((Me.ribbonControl1), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.layoutControl), System.ComponentModel.ISupportInitialize).EndInit() + Me.layoutControl.ResumeLayout(False) + CType((Me.panelControl1), System.ComponentModel.ISupportInitialize).EndInit() + Me.panelControl1.ResumeLayout(False) + CType((Me.dxHtmlEditorWebView), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.targetMemoEdit.Properties), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.sourceMemoEdit.Properties), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.layoutControlGroup1), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.tabbedControlGroup1), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.layoutControlGroup2), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.layoutControlItem4), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.layoutControlGroup3), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.layoutControlItem1), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.layoutControlGroup4), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.layoutControlItem2), System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + End Sub + +#End Region + Private ribbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl + + Private ribbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage + + Private ribbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup + + Private ribbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage + + Private layoutControl As DevExpress.XtraLayout.LayoutControl + + Private targetMemoEdit As DevExpress.XtraEditors.MemoEdit + + Private sourceMemoEdit As DevExpress.XtraEditors.MemoEdit + + Private layoutControlGroup1 As DevExpress.XtraLayout.LayoutControlGroup + + Private dxHtmlEditorWebView As DXHtmlEditor.DXHtmlEditorWebView + + Private skinDropDownButtonItem1 As DevExpress.XtraBars.SkinDropDownButtonItem + + Private panelControl1 As DevExpress.XtraEditors.PanelControl + + Private tabbedControlGroup1 As DevExpress.XtraLayout.TabbedControlGroup + + Private layoutControlGroup3 As DevExpress.XtraLayout.LayoutControlGroup + + Private layoutControlItem1 As DevExpress.XtraLayout.LayoutControlItem + + Private layoutControlGroup2 As DevExpress.XtraLayout.LayoutControlGroup + + Private layoutControlItem4 As DevExpress.XtraLayout.LayoutControlItem + + Private layoutControlGroup4 As DevExpress.XtraLayout.LayoutControlGroup + + Private layoutControlItem2 As DevExpress.XtraLayout.LayoutControlItem + + Private skinPaletteRibbonGalleryBarItem1 As DevExpress.XtraBars.SkinPaletteRibbonGalleryBarItem + + Private bbiUndo As DevExpress.XtraBars.BarButtonItem + + Private ribbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup + + Private bbiRedo As DevExpress.XtraBars.BarButtonItem + End Class +End Namespace diff --git a/VB/MainForm.resx b/VB/MainForm.resx new file mode 100644 index 0000000..a9d0357 --- /dev/null +++ b/VB/MainForm.resx @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5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.vb b/VB/MainForm.vb new file mode 100644 index 0000000..fb0c848 --- /dev/null +++ b/VB/MainForm.vb @@ -0,0 +1,73 @@ +Imports System +Imports DevExpress.XtraSplashScreen + +Namespace DXHtmlEditor + + Public Partial Class MainForm + Inherits DevExpress.XtraBars.Ribbon.RibbonForm + + Public Sub New() + InitializeComponent() + AddHandler dxHtmlEditorWebView.HtmlChanged, AddressOf OnDxHtmlEditorWebViewHtmlChanged + AddHandler dxHtmlEditorWebView.HtmlLoaded, AddressOf OnDxHtmlEditorWebViewHtmlLoaded + End Sub + + Protected Overrides Sub OnLoad(ByVal e As EventArgs) + MyBase.OnLoad(e) + ShowOverlay() + sourceMemoEdit.Text = "Hello DevExpress Html Editor!" + End Sub + + Private Async Sub OnSourceMemoEditTextChanged(ByVal sender As Object, ByVal e As EventArgs) + Await dxHtmlEditorWebView.SetHtmlText(sourceMemoEdit.Text) + End Sub + + Private Async Sub OnUndo(ByVal sender As Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) + Await dxHtmlEditorWebView.Undo() + End Sub + + Private Async Sub OnRedo(ByVal sender As Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) + Await dxHtmlEditorWebView.Redo() + End Sub + + Protected Overrides Sub OnLookAndFeelChangedCore() + UpdateDxHtmlEditorWebViewTheme() + MyBase.OnLookAndFeelChangedCore() + End Sub + + Private ReadOnly Property UseDarkTheme As Boolean + Get + Return DevExpress.Utils.Frames.FrameHelper.IsDarkSkin(GetActiveLookAndFeel()) + End Get + End Property + + Private Async Sub UpdateDxHtmlEditorWebViewTheme() + Dim themeName As String = If(UseDarkTheme, "dx.dark.css", "dx.light.css") + If dxHtmlEditorWebView.CanSetTheme(themeName) Then + ShowOverlay() + Await dxHtmlEditorWebView.SetTheme(themeName) + End If + End Sub + + Private Async Sub OnDxHtmlEditorWebViewHtmlChanged(ByVal sender As Object, ByVal e As EventArgs) + targetMemoEdit.Text = Await dxHtmlEditorWebView.GetHtmlText() + End Sub + + Private Sub OnDxHtmlEditorWebViewHtmlLoaded(ByVal sender As Object, ByVal e As EventArgs) + CloseOverlay() + End Sub + + Private overlayHandle As IOverlaySplashScreenHandle + + Private ReadOnly options As OverlayWindowOptions = New OverlayWindowOptions(opacity:=100R / 255) + + Private Sub ShowOverlay() + overlayHandle = If(overlayHandle, SplashScreenManager.ShowOverlayForm(layoutControl, options)) + End Sub + + Private Sub CloseOverlay() + overlayHandle?.Close() + overlayHandle = Nothing + End Sub + End Class +End Namespace diff --git a/VB/Program.vb b/VB/Program.vb new file mode 100644 index 0000000..ec0aaf1 --- /dev/null +++ b/VB/Program.vb @@ -0,0 +1,18 @@ +Imports System +Imports System.Windows.Forms + +Namespace DXHtmlEditor + + Friend Module Program + + ''' + ''' The main entry point for the application. + ''' + + Sub Main() + Call Application.EnableVisualStyles() + Application.SetCompatibleTextRenderingDefault(False) + Call Application.Run(New MainForm()) + End Sub + End Module +End Namespace diff --git a/VB/Properties/AssemblyInfo.vb b/VB/Properties/AssemblyInfo.vb new file mode 100644 index 0000000..3779970 --- /dev/null +++ b/VB/Properties/AssemblyInfo.vb @@ -0,0 +1,32 @@ +Imports System.Reflection +Imports 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. + + + + + + + + +' 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. + +' The following GUID is for the ID of the typelib if this project is exposed to COM + +' 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.*")] + + diff --git a/VB/Properties/Resources.Designer.vb b/VB/Properties/Resources.Designer.vb new file mode 100644 index 0000000..6408c93 --- /dev/null +++ b/VB/Properties/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' 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. +' +'------------------------------------------------------------------------------ +Namespace DXHtmlEditor.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. + + + + Friend Class Resources + + Private Shared resourceMan As Global.System.Resources.ResourceManager + + Private Shared resourceCulture As Global.System.Globalization.CultureInfo + + + Friend Sub New() + End Sub + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + + Friend Shared ReadOnly Property ResourceManager As Global.System.Resources.ResourceManager + Get + If(DXHtmlEditor.Properties.Resources.resourceMan Is Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Resources", GetType(DXHtmlEditor.Properties.Resources).Assembly) + DXHtmlEditor.Properties.Resources.resourceMan = temp + End If + + Return DXHtmlEditor.Properties.Resources.resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + + Friend Shared Property Culture As Global.System.Globalization.CultureInfo + Get + Return DXHtmlEditor.Properties.Resources.resourceCulture + End Get + + Set(ByVal value As Global.System.Globalization.CultureInfo) + DXHtmlEditor.Properties.Resources.resourceCulture = value + End Set + End Property + End Class +End Namespace diff --git a/VB/Properties/Resources.resx b/VB/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/VB/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/VB/Properties/Settings.Designer.vb b/VB/Properties/Settings.Designer.vb new file mode 100644 index 0000000..eed8886 --- /dev/null +++ b/VB/Properties/Settings.Designer.vb @@ -0,0 +1,25 @@ +'------------------------------------------------------------------------------ +' +' 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. +' +'------------------------------------------------------------------------------ +Namespace DXHtmlEditor.Properties + + + + Friend NotInheritable Partial Class Settings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As DXHtmlEditor.Properties.Settings = CType((Global.System.Configuration.ApplicationSettingsBase.Synchronized(New DXHtmlEditor.Properties.Settings())), DXHtmlEditor.Properties.Settings) + + Public Shared ReadOnly Property [Default] As Settings + Get + Return DXHtmlEditor.Properties.Settings.defaultInstance + End Get + End Property + End Class +End Namespace diff --git a/VB/Properties/Settings.settings b/VB/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/VB/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + +