' © Luuknl
Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports Social_View.My
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.Net
Imports System.Runtime.CompilerServices
Imports System.Windows.Forms
Namespace Social_View
<DesignerGenerated> _
Public Class Updater
Inherits Form
' Methods
<DebuggerNonUserCode> _
Public Sub New()
AddHandler MyBase.Load, New EventHandler(AddressOf Me.Updater_Load)
Updater.__ENCAddToList(Me)
Me.InitializeComponent
End Sub
<DebuggerNonUserCode> _
Private Shared Sub __ENCAddToList(ByVal value As Object)
Dim list As List(Of WeakReference) = Updater.__ENCList
SyncLock list
If (Updater.__ENCList.Count = Updater.__ENCList.Capacity) Then
Dim index As Integer = 0
Dim num3 As Integer = (Updater.__ENCList.Count - 1)
Dim i As Integer = 0
Do While (i <= num3)
Dim reference As WeakReference = Updater.__ENCList.Item(i)
If reference.IsAlive Then
If (i <> index) Then
Updater.__ENCList.Item(index) = Updater.__ENCList.Item(i)
End If
index += 1
End If
i += 1
Loop
Updater.__ENCList.RemoveRange(index, (Updater.__ENCList.Count - index))
Updater.__ENCList.Capacity = Updater.__ENCList.Count
End If
Updater.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value)))
End SyncLock
End Sub
<MethodImpl((MethodImplOptions.NoOptimization Or MethodImplOptions.NoInlining))> _
Private Sub bgwUpdateChecker_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs)
If MyProject.Computer.Network.IsAvailable Then
Try
If (Operators.CompareString(New WebClient().DownloadString("http://luuknl.woelmuis.nl/Programma%20Bestanden/Social%20View/Version.txt"), MyProject.Application.Info.Version.ToString.Replace(".", Nothing), False) > 0) Then
Me.UpdateAvailable = True
Else
Me.UpdateAvailable = False
End If
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
If (MySettingsProperty.Settings.Language = "Nederlands") Then
Interaction.MsgBox("Er kan geen verbinding worden gemaakt. Mogelijk is er geen internet verbinding, of is de website niet beschikbaar.", MsgBoxStyle.OkOnly, Nothing)
End If
If (MySettingsProperty.Settings.Language = "Engels") Then
Interaction.MsgBox("Unable to connect to the Internet. There may be no internet connection, or the website is unavailable.", MsgBoxStyle.OkOnly, Nothing)
End If
If (MySettingsProperty.Settings.Language = "Duits") Then
Interaction.MsgBox("Konnte keine Verbindung zum Internet herstellen. Es kann keine Internet-Verbindung, oder die Website nicht verf" & ChrW(252) & "gbar ist.", MsgBoxStyle.OkOnly, Nothing)
End If
ProjectData.ClearProjectError
End Try
Else
If (MySettingsProperty.Settings.Language = "Nederlands") Then
Interaction.MsgBox("Er is geen verbinding met het internet. Controleer de instellingen en probeer het opnieuw.", MsgBoxStyle.OkOnly, Nothing)
End If
If (MySettingsProperty.Settings.Language = "Engels") Then
Interaction.MsgBox("There is no connection to the Internet. Please check your settings and try again.", MsgBoxStyle.OkOnly, Nothing)
End If
If (MySettingsProperty.Settings.Language = "Duits") Then
Interaction.MsgBox("Es besteht keine Verbindung zum Internet. Bitte " & ChrW(252) & "berpr" & ChrW(252) & "fen Sie Ihre Einstellungen und versuchen Sie es erneut", MsgBoxStyle.OkOnly, Nothing)
End If
End If
End Sub
Private Sub bgwUpdateChecker_RunWorkerCompleted(ByVal sender As Object, ByVal e As RunWorkerCompletedEventArgs)
Me.Button1.Enabled = True
Me.pgbUpdateCheck.Visible = False
If Me.UpdateAvailable Then
If (MySettingsProperty.Settings.Language = "Nederlands") Then
Me.Label1.Text = "Er is een update beschikbaar."
Me.LinkLabel1.Visible = True
Me.LinkLabel1.Text = "Klik hier om de nieuwste versie te downloaden."
End If
If (MySettingsProperty.Settings.Language = "Engels") Then
Me.Label1.Text = "An update is available."
Me.LinkLabel1.Visible = True
Me.LinkLabel1.Text = "Click here to download the latest version."
End If
If (MySettingsProperty.Settings.Language = "Duits") Then
Me.Label1.Text = "Ein Update ist verf" & ChrW(252) & "gbar"
Me.LinkLabel1.Visible = True
Me.LinkLabel1.Text = "Klicken Sie hier um die neueste Version herunterladen"
End If
Else
If (MySettingsProperty.Settings.Language = "Nederlands") Then
Me.Label1.Text = "Er is geen update beschikbaar."
End If
If (MySettingsProperty.Settings.Language = "Engels") Then
Me.Label1.Text = "No update available."
End If
If (MySettingsProperty.Settings.Language = "Duits") Then
Me.Label1.Text = "Kein Update verf" & ChrW(252) & "gbar."
End If
End If
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Me.Button1.Enabled = False
If (MySettingsProperty.Settings.Language = "Nederlands") Then
Me.Label1.Text = "Bezig met controleren op update, een ogenblik geduld..."
End If
If (MySettingsProperty.Settings.Language = "Engels") Then
Me.Label1.Text = "Checking for updates, please wait..."
End If
If (MySettingsProperty.Settings.Language = "Duits") Then
Me.Label1.Text = "Suche nach Updates, Bitte warten"
End If
Me.pgbUpdateCheck.Visible = True
Me.bgwUpdateChecker.RunWorkerAsync
Me.LinkLabel1.Visible = False
End Sub
<DebuggerNonUserCode> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If (disposing AndAlso (Not Me.components Is Nothing)) Then
Me.components.Dispose
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
<DebuggerStepThrough> _
Private Sub InitializeComponent()
Me.pgbUpdateCheck = New ProgressBar
Me.Label1 = New Label
Me.bgwUpdateChecker = New BackgroundWorker
Me.LinkLabel1 = New LinkLabel
Me.Button1 = New Button
Me.SuspendLayout
Dim point2 As New Point(&H11, &H1D)
Me.pgbUpdateCheck.Location = point2
Me.pgbUpdateCheck.MarqueeAnimationSpeed = &H19
Me.pgbUpdateCheck.Name = "pgbUpdateCheck"
Dim size2 As New Size(&H12D, &H17)
Me.pgbUpdateCheck.Size = size2
Me.pgbUpdateCheck.Style = ProgressBarStyle.Marquee
Me.pgbUpdateCheck.TabIndex = 5
Me.pgbUpdateCheck.Visible = False
Me.Label1.AutoSize = True
point2 = New Point(14, 13)
Me.Label1.Location = point2
Me.Label1.Name = "Label1"
size2 = New Size(&H11E, 13)
Me.Label1.Size = size2
Me.Label1.TabIndex = 4
Me.Label1.Text = "Druk op 'Zoek naar updates' om te controleren op updates."
Me.LinkLabel1.AutoSize = True
point2 = New Point(14, &H3A)
Me.LinkLabel1.Location = point2
Me.LinkLabel1.Name = "LinkLabel1"
size2 = New Size(&HE4, 13)
Me.LinkLabel1.Size = size2
Me.LinkLabel1.TabIndex = 7
Me.LinkLabel1.TabStop = True
Me.LinkLabel1.Tag = ""
Me.LinkLabel1.Text = "Klik hier om de nieuwste versie te downloaden."
Me.LinkLabel1.Visible = False
Me.Button1.AutoSize = True
point2 = New Point(&H15A, &H1D)
Me.Button1.Location = point2
Me.Button1.Name = "Button1"
size2 = New Size(110, &H17)
Me.Button1.Size = size2
Me.Button1.TabIndex = 6
Me.Button1.Text = "Zoek naar updates"
Me.Button1.UseVisualStyleBackColor = True
Dim ef2 As New SizeF(6!, 13!)
Me.AutoScaleDimensions = ef2
Me.AutoScaleMode = AutoScaleMode.Font
size2 = New Size(&H1E2, &H54)
Me.ClientSize = size2
Me.Controls.Add(Me.pgbUpdateCheck)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.LinkLabel1)
Me.Controls.Add(Me.Button1)
Me.FormBorderStyle = FormBorderStyle.FixedToolWindow
Me.Name = "Updater"
Me.StartPosition = FormStartPosition.CenterScreen
Me.Text = "Updater"
Me.ResumeLayout(False)
Me.PerformLayout
End Sub
Private Sub LinkLabel1_LinkClicked(ByVal sender As Object, ByVal e As LinkLabelLinkClickedEventArgs)
Process.Start("http://luuknl.woelmuis.nl/Programma%20Bestanden/Social%20View/SView.zip")
End Sub
Private Sub Updater_Load(ByVal sender As Object, ByVal e As EventArgs)
Me.LinkLabel1.Visible = False
If (MySettingsProperty.Settings.Language = "Nederlands") Then
Me.Label1.Text = "Druk op 'Zoek naar updates' om te controleren op updates."
Me.Button1.Text = "Zoek naar updates"
End If
If (MySettingsProperty.Settings.Language = "Engels") Then
Me.Label1.Text = "Press 'Check for updates' to check for updates."
Me.Button1.Text = "Check for updates"
End If
If (MySettingsProperty.Settings.Language = "Duits") Then
Me.Label1.Text = "Dr" & ChrW(252) & "cken Sie 'Nach Updates suchen' um nach Updates zu suchen."
Me.Button1.Text = "Nach Updates suchen"
End If
End Sub
' Properties
Friend Overridable Property bgwUpdateChecker As BackgroundWorker
<DebuggerNonUserCode> _
Get
Return Me._bgwUpdateChecker
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As BackgroundWorker)
Dim handler As DoWorkEventHandler = New DoWorkEventHandler(AddressOf Me.bgwUpdateChecker_DoWork)
Dim handler2 As RunWorkerCompletedEventHandler = New RunWorkerCompletedEventHandler(AddressOf Me.bgwUpdateChecker_RunWorkerCompleted)
If (Not Me._bgwUpdateChecker Is Nothing) Then
RemoveHandler Me._bgwUpdateChecker.DoWork, handler
RemoveHandler Me._bgwUpdateChecker.RunWorkerCompleted, handler2
End If
Me._bgwUpdateChecker = WithEventsValue
If (Not Me._bgwUpdateChecker Is Nothing) Then
AddHandler Me._bgwUpdateChecker.DoWork, handler
AddHandler Me._bgwUpdateChecker.RunWorkerCompleted, handler2
End If
End Set
End Property
Friend Overridable Property Button1 As Button
<DebuggerNonUserCode> _
Get
Return Me._Button1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As Button)
Dim handler As EventHandler = New EventHandler(AddressOf Me.Button1_Click)
If (Not Me._Button1 Is Nothing) Then
RemoveHandler Me._Button1.Click, handler
End If
Me._Button1 = WithEventsValue
If (Not Me._Button1 Is Nothing) Then
AddHandler Me._Button1.Click, handler
End If
End Set
End Property
Friend Overridable Property Label1 As Label
<DebuggerNonUserCode> _
Get
Return Me._Label1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As Label)
Me._Label1 = WithEventsValue
End Set
End Property
Friend Overridable Property LinkLabel1 As LinkLabel
<DebuggerNonUserCode> _
Get
Return Me._LinkLabel1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As LinkLabel)
Dim handler As LinkLabelLinkClickedEventHandler = New LinkLabelLinkClickedEventHandler(AddressOf Me.LinkLabel1_LinkClicked)
If (Not Me._LinkLabel1 Is Nothing) Then
RemoveHandler Me._LinkLabel1.LinkClicked, handler
End If
Me._LinkLabel1 = WithEventsValue
If (Not Me._LinkLabel1 Is Nothing) Then
AddHandler Me._LinkLabel1.LinkClicked, handler
End If
End Set
End Property
Friend Overridable Property pgbUpdateCheck As ProgressBar
<DebuggerNonUserCode> _
Get
Return Me._pgbUpdateCheck
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As ProgressBar)
Me._pgbUpdateCheck = WithEventsValue
End Set
End Property
' Fields
Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference)
<AccessedThroughProperty("bgwUpdateChecker")> _
Private _bgwUpdateChecker As BackgroundWorker
<AccessedThroughProperty("Button1")> _
Private _Button1 As Button
<AccessedThroughProperty("Label1")> _
Private _Label1 As Label
<AccessedThroughProperty("LinkLabel1")> _
Private _LinkLabel1 As LinkLabel
<AccessedThroughProperty("pgbUpdateCheck")> _
Private _pgbUpdateCheck As ProgressBar
Private components As IContainer
Private UpdateAvailable As Boolean
End Class
End Namespace