mirror of
https://github.com/AAndyProgram/SCrawler.git
synced 2026-03-14 15:52:18 +00:00
ADD MULTI-ACCOUNT PluginProvider IDownloadableMedia: added 'AccountName' property IPluginContentProvider: added 'AccountName' property ISiteSettings: added properties: 'AccountName', 'Temporary', 'AvailableText', 'DefaultInstance'; added functions: 'Clone', 'Update', 'Delete'; removed 'Load' function; implement 'IDisposable' interface PropertyValue: added functions: 'BeginInit', 'EndInit', 'Clone' YT YouTubeSettings: make the class compatible for multi-acc YouTubeMediaContainerBase: add 'AccountName' property SCrawler IUserData: add properties: 'HostStatic', 'AccountName' ProfileSaved: add the ability to download saved posts from all accounts SiteSettingsBase: add multi-acc support; add 'UserOptionsType' for future purposes; update initializers; update responser initializing; add 'CLONE_PROPERTIES' and 'CloneGetEmptySettingsInstance' functions; 'IDisposable' support UserDataBase: add multi-acc support; change host retrieval method DomainsContainer: implements 'IDisposable' interface API.All sites: add multi-acc support; move the Icon and Image setting to the initializer; update initializer API.Instagram: change some property types API.Reddit: set 'AvailableText'; update 'UpdateRedGifsToken' and 'UserOptions' functions API.Mastodon: remove 'MastodonDomains' class and 'SettingsForm' form; replace 'MastodonDomains' with 'DomainsContainer'; update functions 'IsMyUser' and 'IsMyImageVideo'; update to 'DefaultInstance' environment; update 'UserData.ResetCredentials' function API.XVIDEOS: update to 'DefaultInstance' environment API.Xhamster: update to 'DefaultInstance' environment STDownloader: add multi-acc compatibility SiteEditorForm: add option 'Download saved posts'; update providers; add additional providers; add multi-acc support PluginsEnvironment: add 'PClonableAttribute'; add multi-acc support
74 lines
3.3 KiB
VB.net
74 lines
3.3 KiB
VB.net
' Copyright (C) 2023 Andy https://github.com/AAndyProgram
|
|
' This program is free software: you can redistribute it and/or modify
|
|
' it under the terms of the GNU General Public License as published by
|
|
' the Free Software Foundation, either version 3 of the License, or
|
|
' (at your option) any later version.
|
|
'
|
|
' This program is distributed in the hope that it will be useful,
|
|
' but WITHOUT ANY WARRANTY
|
|
Namespace Plugin
|
|
Public NotInheritable Class PropertyValue : Implements IPropertyValue
|
|
Public Event ValueChanged As IPropertyValue.ValueChangedEventHandler Implements IPropertyValue.ValueChanged
|
|
Public Property [Type] As Type Implements IPropertyValue.Type
|
|
Public Property OnChangeFunction As IPropertyValue.ValueChangedEventHandler
|
|
Private _Initialization As Boolean = False
|
|
''' <inheritdoc cref="PropertyValue.New(Object, Type, ByRef IPropertyValue.ValueChangedEventHandler)"/>
|
|
''' <exception cref="ArgumentNullException"></exception>
|
|
Public Sub New(ByVal InitValue As Object)
|
|
_Value = InitValue
|
|
If IsNothing(InitValue) Then
|
|
Throw New ArgumentNullException("InitValue", "InitValue cannot be null")
|
|
Else
|
|
[Type] = _Value.GetType
|
|
End If
|
|
End Sub
|
|
''' <inheritdoc cref="PropertyValue.New(Object, Type, ByRef IPropertyValue.ValueChangedEventHandler)"/>
|
|
Public Sub New(ByVal InitValue As Object, ByVal T As Type)
|
|
_Value = InitValue
|
|
[Type] = T
|
|
End Sub
|
|
''' <summary>New property value instance</summary>
|
|
''' <param name="InitValue">Initialization value</param>
|
|
''' <param name="T">Value type</param>
|
|
''' <param name="RFunction">CallBack function on value change</param>
|
|
Public Sub New(ByVal InitValue As Object, ByVal T As Type, ByRef RFunction As IPropertyValue.ValueChangedEventHandler)
|
|
Me.New(InitValue, T)
|
|
OnChangeFunction = RFunction
|
|
End Sub
|
|
Private _Value As Object
|
|
Public Property Value As Object Implements IPropertyValue.Value
|
|
Get
|
|
Return _Value
|
|
End Get
|
|
Set(ByVal NewValue As Object)
|
|
_Value = NewValue
|
|
If Not _Initialization Then
|
|
If Not OnChangeFunction Is Nothing Then OnChangeFunction.Invoke(Value)
|
|
RaiseEvent ValueChanged(_Value)
|
|
End If
|
|
End Set
|
|
End Property
|
|
Public Sub BeginInit()
|
|
_Initialization = True
|
|
End Sub
|
|
Public Sub EndInit()
|
|
_Initialization = False
|
|
End Sub
|
|
Public Sub Clone(ByVal Source As PropertyValue)
|
|
_Initialization = True
|
|
Type = Source.Type
|
|
OnChangeFunction = Source.OnChangeFunction
|
|
_Value = Source._Value
|
|
_Initialization = False
|
|
End Sub
|
|
End Class
|
|
Public Interface IPropertyValue
|
|
''' <summary>Event for internal exchange</summary>
|
|
''' <param name="Value">New value</param>
|
|
Event ValueChanged(ByVal Value As Object)
|
|
''' <summary>Value type</summary>
|
|
Property [Type] As Type
|
|
''' <summary>Property value</summary>
|
|
Property Value As Object
|
|
End Interface
|
|
End Namespace |