First create solution
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
Imports System.Windows.Forms
|
||||
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class WaitForm
|
||||
Inherits DevExpress.XtraWaitForm.WaitForm
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.StyleController1 = New DevExpress.XtraEditors.StyleController(Me.components)
|
||||
Me.tableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
|
||||
Me.progressPanel1 = New DevExpress.XtraWaitForm.ProgressPanel()
|
||||
CType(Me.StyleController1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.tableLayoutPanel1.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'tableLayoutPanel1
|
||||
'
|
||||
Me.tableLayoutPanel1.AutoSize = True
|
||||
Me.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
|
||||
Me.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent
|
||||
Me.tableLayoutPanel1.ColumnCount = 1
|
||||
Me.tableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
||||
Me.tableLayoutPanel1.Controls.Add(Me.progressPanel1, 0, 0)
|
||||
Me.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.tableLayoutPanel1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.tableLayoutPanel1.Name = "tableLayoutPanel1"
|
||||
Me.tableLayoutPanel1.Padding = New System.Windows.Forms.Padding(0, 14, 0, 14)
|
||||
Me.tableLayoutPanel1.RowCount = 1
|
||||
Me.tableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
||||
Me.tableLayoutPanel1.Size = New System.Drawing.Size(481, 248)
|
||||
Me.tableLayoutPanel1.TabIndex = 2
|
||||
Me.tableLayoutPanel1.UseWaitCursor = True
|
||||
'
|
||||
'progressPanel1
|
||||
'
|
||||
Me.progressPanel1.Appearance.BackColor = System.Drawing.Color.Transparent
|
||||
Me.progressPanel1.Appearance.Options.UseBackColor = True
|
||||
Me.progressPanel1.AppearanceCaption.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!)
|
||||
Me.progressPanel1.AppearanceCaption.Options.UseFont = True
|
||||
Me.progressPanel1.AppearanceDescription.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!)
|
||||
Me.progressPanel1.AppearanceDescription.Options.UseFont = True
|
||||
Me.progressPanel1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.progressPanel1.ImageHorzOffset = 20
|
||||
Me.progressPanel1.Location = New System.Drawing.Point(0, 17)
|
||||
Me.progressPanel1.Margin = New System.Windows.Forms.Padding(0, 3, 0, 3)
|
||||
Me.progressPanel1.Name = "progressPanel1"
|
||||
Me.progressPanel1.Size = New System.Drawing.Size(481, 214)
|
||||
Me.progressPanel1.StyleController = Me.StyleController1
|
||||
Me.progressPanel1.TabIndex = 0
|
||||
Me.progressPanel1.Text = "progressPanel1"
|
||||
Me.progressPanel1.UseWaitCursor = True
|
||||
'
|
||||
'WaitForm
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.AutoSize = True
|
||||
Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
|
||||
Me.ClientSize = New System.Drawing.Size(481, 248)
|
||||
Me.Controls.Add(Me.tableLayoutPanel1)
|
||||
Me.DoubleBuffered = True
|
||||
Me.Name = "WaitForm"
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
|
||||
Me.Text = "Form1"
|
||||
CType(Me.StyleController1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.tableLayoutPanel1.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
Friend WithEvents StyleController1 As DevExpress.XtraEditors.StyleController
|
||||
Private WithEvents tableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
|
||||
Private WithEvents progressPanel1 As DevExpress.XtraWaitForm.ProgressPanel
|
||||
|
||||
'Friend WithEvents StyleController1 As DevExpress.XtraEditors.StyleController
|
||||
End Class
|
||||
@@ -0,0 +1,123 @@
|
||||
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<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" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="StyleController1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,25 @@
|
||||
Public Class WaitForm
|
||||
|
||||
Sub New()
|
||||
InitializeComponent()
|
||||
Me.progressPanel1.AutoHeight = True
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub SetCaption(ByVal caption As String)
|
||||
MyBase.SetCaption(caption)
|
||||
Me.progressPanel1.Caption = caption
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub SetDescription(ByVal description As String)
|
||||
MyBase.SetDescription(description)
|
||||
Me.progressPanel1.Description = description
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub ProcessCommand(ByVal cmd As System.Enum, ByVal arg As Object)
|
||||
MyBase.ProcessCommand(cmd, arg)
|
||||
End Sub
|
||||
|
||||
Public Enum WaitFormCommand
|
||||
SomeCommandId
|
||||
End Enum
|
||||
End Class
|
||||
@@ -0,0 +1,109 @@
|
||||
Imports DevExpress.XtraSplashScreen
|
||||
Imports System.Threading
|
||||
Public Class WaitFormClass
|
||||
Private _WaitForm_Minimum As Long = -1
|
||||
Private _WaitForm_Maximum As Long = -1
|
||||
Private _WaitForm_Step As Long = -1
|
||||
Private _Current_Step As Long = -1
|
||||
Private _Current_Percent As Double = 0
|
||||
Private _Last_Percent As Double = 0
|
||||
Private _Act_Displayed_Time As Date
|
||||
Private _Prev_Displayed_Time As Date
|
||||
Private _StartTime As Date
|
||||
Private _Caption As String
|
||||
Private _DoThread As Boolean = False
|
||||
Private _ThreadHandler As Thread
|
||||
Public Property Caption
|
||||
Get
|
||||
Return _Caption
|
||||
End Get
|
||||
Set(value)
|
||||
_Caption = value
|
||||
End Set
|
||||
End Property
|
||||
Public Sub Initwork(ByVal _Minimum As Long, ByVal _Step As Long, ByVal _Maximum As Long)
|
||||
_WaitForm_Minimum = _Minimum
|
||||
_WaitForm_Maximum = _Maximum
|
||||
_WaitForm_Step = _Step
|
||||
_Current_Step = 0
|
||||
_Current_Percent = 0
|
||||
_Last_Percent = 0
|
||||
_Act_Displayed_Time = Now
|
||||
_Prev_Displayed_Time = Date.MinValue
|
||||
_StartTime = Now
|
||||
SplashScreenManager.ShowForm(Nothing, GetType(WaitForm), True, False, False)
|
||||
System.Windows.Forms.Application.DoEvents()
|
||||
_DoThread = True
|
||||
_ThreadHandler = New Thread(AddressOf ThreadTask)
|
||||
_ThreadHandler.IsBackground = True
|
||||
_ThreadHandler.Start()
|
||||
End Sub
|
||||
Public Sub DoWork()
|
||||
Dim _EstimatedSec As Long = 0
|
||||
Dim _SpentSec As Long = 0
|
||||
_Current_Step += _WaitForm_Step
|
||||
_Current_Percent = Math.Round(_Current_Step / _WaitForm_Maximum * 100, 0, MidpointRounding.AwayFromZero)
|
||||
|
||||
|
||||
If _Last_Percent <> _Current_Percent Then
|
||||
Try
|
||||
If Caption = "" Then
|
||||
SplashScreenManager.Default.SetWaitFormCaption(String.Format("Kérem várjon, dolgozom ... {0}", Format(_StartTime, "hh:mm:ss")))
|
||||
Else
|
||||
SplashScreenManager.Default.SetWaitFormCaption(Me.Caption)
|
||||
End If
|
||||
_SpentSec = DateDiff(DateInterval.Second, _StartTime, Now)
|
||||
_EstimatedSec = ((_SpentSec / _Current_Step) * (_WaitForm_Maximum - _Current_Step)) + 1
|
||||
Dim iSpan As TimeSpan = TimeSpan.FromSeconds(_EstimatedSec)
|
||||
|
||||
SplashScreenManager.Default.SetWaitFormDescription(String.Format("{0}% ,{1}/{2}, eltelt idő: {3}, becsült hátralévő : {4}:{5}:{6}",
|
||||
_Current_Percent, _Current_Step, _WaitForm_Maximum, FormatEllapsedTime(),
|
||||
iSpan.Hours.ToString, iSpan.Minutes.ToString, iSpan.Seconds.ToString))
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
_Last_Percent = _Current_Percent
|
||||
End If
|
||||
System.Windows.Forms.Application.DoEvents()
|
||||
End Sub
|
||||
Public Sub FinalWork()
|
||||
_DoThread = False
|
||||
_ThreadHandler = Nothing
|
||||
SplashScreenManager.CloseForm(False)
|
||||
System.Windows.Forms.Application.DoEvents()
|
||||
End Sub
|
||||
Private Function FormatEllapsedTime() As String
|
||||
Dim iSpan As TimeSpan = TimeSpan.FromSeconds(DateDiff(DateInterval.Second, _StartTime, Now).ToString)
|
||||
Return String.Format("{0}:{1}:{2}", iSpan.Hours.ToString, iSpan.Minutes.ToString, iSpan.Seconds.ToString)
|
||||
End Function
|
||||
|
||||
'// THREADING
|
||||
Private Sub ThreadTask()
|
||||
Dim _EstimatedSec As Long = 0
|
||||
Dim _SpentSec As Long = 0
|
||||
|
||||
While _DoThread
|
||||
_Act_Displayed_Time = Now
|
||||
Try
|
||||
If _Act_Displayed_Time <> _Prev_Displayed_Time Then
|
||||
If DateDiff(DateInterval.Second, _Prev_Displayed_Time, _Act_Displayed_Time) >= 1 Then
|
||||
_SpentSec = DateDiff(DateInterval.Second, _StartTime, Now)
|
||||
|
||||
_EstimatedSec = ((_SpentSec / _Current_Step) * (_WaitForm_Maximum - _Current_Step)) + 1
|
||||
Dim iSpan As TimeSpan = TimeSpan.FromSeconds(_EstimatedSec)
|
||||
|
||||
SplashScreenManager.Default.SetWaitFormDescription(String.Format("{0}% ,{1}/{2}, eltelt idő: {3}, becsült hátralévő : {4}:{5}:{6}",
|
||||
_Current_Percent, _Current_Step, _WaitForm_Maximum, FormatEllapsedTime(),
|
||||
iSpan.Hours.ToString, iSpan.Minutes.ToString, iSpan.Seconds.ToString))
|
||||
|
||||
_Prev_Displayed_Time = Now
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
Thread.Sleep(1000)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user