First create solution
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
Partial Class SISChatVC
|
||||
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
|
||||
MyClass.New()
|
||||
|
||||
'Required for Windows.Forms Class Composition Designer support
|
||||
Container.Add(Me)
|
||||
|
||||
End Sub
|
||||
|
||||
'Component overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
'Required by the Component Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Component Designer
|
||||
'It can be modified using the Component Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
components = New System.ComponentModel.Container()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,135 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Diagnostics
|
||||
Imports System.Text
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.ExpressApp.Actions
|
||||
Imports DevExpress.Persistent.Base
|
||||
|
||||
Imports DevExpress.XtraEditors
|
||||
Imports DevExpress.ExpressApp.HtmlPropertyEditor.Win
|
||||
Imports System.Windows.Forms
|
||||
Imports System.Net
|
||||
Imports System.IO
|
||||
|
||||
Public Class SISChatVC
|
||||
Inherits Nuvolar.Module.SISChatVC
|
||||
Private ChatTimerCore As Timer
|
||||
#If DEBUG Then
|
||||
Private _SISChatURL As String = "http://192.168.1.102/SISChat/SISChat.ashx?id="
|
||||
#Else
|
||||
Private _SISChatURL As String = "http://sis-r.hu/SISChat/SISChat.ashx?id="
|
||||
#End If
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
|
||||
'This call is required by the Component Designer.
|
||||
InitializeComponent()
|
||||
RegisterActions(components)
|
||||
|
||||
End Sub
|
||||
Protected Overrides Sub OnActivated()
|
||||
MyBase.OnActivated()
|
||||
If View.Id = "SISChat_DetailView" Then
|
||||
AddHandler Me.MyAutoscroll, AddressOf MyAutoscroll_Scroll
|
||||
Dim _HTMLBody As DevExpress.ExpressApp.Validation.Win.MemoEditStringPropertyEditor = TryCast(View, DetailView).FindItem("HTMLBody")
|
||||
If _HTMLBody IsNot Nothing Then
|
||||
AddHandler _HTMLBody.ControlCreated, AddressOf HTMLBody_ControlCreated
|
||||
|
||||
End If
|
||||
InitChatTimerCore()
|
||||
End If
|
||||
End Sub
|
||||
Protected Overrides Sub OnDeactivated()
|
||||
MyBase.OnDeactivated()
|
||||
If ChatTimerCore IsNot Nothing Then
|
||||
RemoveHandler ChatTimerCore.Tick, AddressOf ChatTimerCore_Tick
|
||||
End If
|
||||
End Sub
|
||||
Protected Overrides Sub OnViewControlsCreated()
|
||||
MyBase.OnViewControlsCreated()
|
||||
|
||||
If View.Id = "SISChat_DetailView" Then
|
||||
Dim _HtmlPropertyEditor As HtmlPropertyEditor
|
||||
|
||||
_HtmlPropertyEditor = TryCast(View, DetailView).FindItem("HTMLEvents")
|
||||
If _HtmlPropertyEditor IsNot Nothing Then
|
||||
If _HtmlPropertyEditor.Editor IsNot Nothing Then
|
||||
If _HtmlPropertyEditor.Editor.TabControl IsNot Nothing Then
|
||||
If _HtmlPropertyEditor.Editor.TabControl.TabPages(1) IsNot Nothing Then
|
||||
_HtmlPropertyEditor.Editor.TabControl.TabPages(1).PageVisible = False
|
||||
End If
|
||||
End If
|
||||
If _HtmlPropertyEditor.Editor.BrowserControl IsNot Nothing Then
|
||||
_HtmlPropertyEditor.Editor.BrowserControl.Document.Window.ScrollTo(0, Int16.MaxValue)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub MyAutoscroll_Scroll(sender As Object, e As EventArgs)
|
||||
Dim _DetailView As DetailView = TryCast(View, DetailView)
|
||||
If _DetailView IsNot Nothing Then
|
||||
Dim _HtmlPropertyEditor As HtmlPropertyEditor = TryCast(View, DetailView).FindItem("HTMLEvents")
|
||||
If _HtmlPropertyEditor IsNot Nothing Then
|
||||
If _HtmlPropertyEditor.Editor IsNot Nothing Then
|
||||
_HtmlPropertyEditor.Editor.BrowserControl.Document.Window.ScrollTo(0, Int16.MaxValue)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Overridable Sub InitChatTimerCore()
|
||||
ChatTimerCore = New Timer()
|
||||
AddHandler ChatTimerCore.Tick, AddressOf ChatTimerCore_Tick
|
||||
ChatTimerCore.Interval = 3000
|
||||
ChatTimerCore.Start()
|
||||
End Sub
|
||||
|
||||
Private Sub ChatTimerCore_Tick(sender As Object, e As EventArgs)
|
||||
'// Itt kell lekérni a cuccokat
|
||||
ChatTimerCore.Enabled = False
|
||||
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
|
||||
Dim _SISChat As SISChat = TryCast(View.SelectedObjects(0), SISChat)
|
||||
Dim _JSON As String
|
||||
|
||||
|
||||
_JSON = _SISChat.CreateJSONSerialize(_SISChat.HTMLBody, eChatDirection.eOut)
|
||||
|
||||
Try
|
||||
Dim URL As String = _SISChatURL & _JSON
|
||||
Dim request As HttpWebRequest = TryCast(WebRequest.Create(URL), HttpWebRequest)
|
||||
Dim response As HttpWebResponse = TryCast(request.GetResponse, HttpWebResponse)
|
||||
|
||||
Dim reader As StreamReader = New StreamReader(response.GetResponseStream())
|
||||
Dim str As String = reader.ReadToEnd
|
||||
|
||||
If _SISChat.HTMLEvents <> str Then
|
||||
_SISChat.HTMLEvents = str
|
||||
MyAutoscroll_Scroll(sender, e)
|
||||
End If
|
||||
Catch exp As Exception
|
||||
_SISChat.HTMLEvents = exp.Message
|
||||
|
||||
End Try
|
||||
|
||||
ChatTimerCore.Enabled = True
|
||||
End Sub
|
||||
|
||||
Private Sub HTMLBody_KeyUp(sender As Object, e As KeyEventArgs)
|
||||
If e.KeyCode = 13 Then
|
||||
|
||||
Frame.GetController(Of SISChatVC).aSISChatSubmit.DoExecute()
|
||||
e.Handled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub HTMLBody_ControlCreated(sender As Object, e As EventArgs)
|
||||
Dim _HTMLBody As DevExpress.ExpressApp.Validation.Win.MemoEditStringPropertyEditor = TryCast(sender, DevExpress.ExpressApp.Validation.Win.MemoEditStringPropertyEditor)
|
||||
If _HTMLBody IsNot Nothing Then
|
||||
AddHandler _HTMLBody.Control.KeyUp, AddressOf HTMLBody_KeyUp
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
@@ -0,0 +1,31 @@
|
||||
Partial Class SISChatWC
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
|
||||
MyClass.New()
|
||||
|
||||
'Required for Windows.Forms Class Composition Designer support
|
||||
Container.Add(Me)
|
||||
|
||||
End Sub
|
||||
|
||||
'Component overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
'Required by the Component Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Component Designer
|
||||
'It can be modified using the Component Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
components = New System.ComponentModel.Container()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,52 @@
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Diagnostics
|
||||
Imports System.Text
|
||||
|
||||
Imports DevExpress.ExpressApp
|
||||
Imports DevExpress.ExpressApp.Actions
|
||||
Imports DevExpress.Persistent.Base
|
||||
|
||||
Imports System.Windows.Forms
|
||||
Imports DevExpress.XtraBars.Alerter
|
||||
Imports DevExpress.ExpressApp.Utils
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
|
||||
Public Class SISChatWC
|
||||
Inherits DevExpress.ExpressApp.WindowController
|
||||
|
||||
Private ChatAlertControlCore As AlertControl
|
||||
Private ChatAlertTimerCore As Timer
|
||||
Private ChatTimerCore As Timer
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
|
||||
'This call is required by the Component Designer.
|
||||
InitializeComponent()
|
||||
RegisterActions(components)
|
||||
|
||||
TargetWindowType = WindowType.Main
|
||||
End Sub
|
||||
Protected Overrides Sub OnActivated()
|
||||
MyBase.OnActivated()
|
||||
|
||||
'// Meg kell nézni, hogy a felhasználó tud-e Chatelni !
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Overridable Sub InitChatTimerCore()
|
||||
ChatTimerCore = New Timer()
|
||||
AddHandler ChatTimerCore.Tick, AddressOf ChatTimerCore_Tick
|
||||
ChatTimerCore.Interval = 5000
|
||||
ChatTimerCore.Start()
|
||||
End Sub
|
||||
|
||||
Private Sub ChatTimerCore_Tick(sender As Object, e As EventArgs)
|
||||
'// Itt kell lekérni a cuccokat
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user