From 6ca90f0489ac1e072714549e4d34321bcc513d40 Mon Sep 17 00:00:00 2001 From: Andy <88590076+AAndyProgram@users.noreply.github.com> Date: Sat, 25 Feb 2023 10:19:18 +0300 Subject: [PATCH] Update names --- SCrawler/API/Base/UserDataBase.vb | 3 ++- SCrawler/API/BaseObjects/DomainEnvir.vb | 2 +- SCrawler/API/Instagram/SiteSettings.vb | 5 ++-- SCrawler/Channels/ChannelViewForm.vb | 6 ++--- SCrawler/Download/Feed/FeedMedia.vb | 1 - SCrawler/Editors/SiteDefaults.vb | 4 +-- SCrawler/LabelsKeeper.vb | 6 ++--- SCrawler/MainFrame.vb | 2 +- SCrawler/MainMod.vb | 2 +- .../PluginsEnvironment/Hosts/PluginHost.vb | 2 +- .../Hosts/PropertyValueHost.vb | 3 ++- .../PluginsEnvironment/Hosts/SettingsHost.vb | 5 ++-- SCrawler/SettingsCLS.vb | 25 ++++++++++--------- 13 files changed, 35 insertions(+), 31 deletions(-) diff --git a/SCrawler/API/Base/UserDataBase.vb b/SCrawler/API/Base/UserDataBase.vb index 5693be4..cc1b5a4 100644 --- a/SCrawler/API/Base/UserDataBase.vb +++ b/SCrawler/API/Base/UserDataBase.vb @@ -7,6 +7,7 @@ ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY Imports PersonalUtilities.Functions.XML +Imports PersonalUtilities.Functions.XML.Objects Imports PersonalUtilities.Functions.RegularExpressions Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Tools @@ -250,7 +251,7 @@ Namespace API.Base Catch End Try End Sub - Protected Function GetNullPicture(ByVal MaxHeigh As XML.Base.XMLValue(Of Integer)) As Bitmap + Protected Function GetNullPicture(ByVal MaxHeigh As XMLValue(Of Integer)) As Bitmap Return New Bitmap(CInt(DivideWithZeroChecking(MaxHeigh.Value, 100) * 75), MaxHeigh.Value) End Function Friend Function GetPicture(Of T)(Optional ByVal ReturnNullImageOnNothing As Boolean = True, Optional ByVal GetToast As Boolean = False) As T diff --git a/SCrawler/API/BaseObjects/DomainEnvir.vb b/SCrawler/API/BaseObjects/DomainEnvir.vb index b9374eb..1dc66c6 100644 --- a/SCrawler/API/BaseObjects/DomainEnvir.vb +++ b/SCrawler/API/BaseObjects/DomainEnvir.vb @@ -71,7 +71,7 @@ Namespace API.BaseObjects .Icon = s.Icon, .LocationOnly = True, .Size = New Size(400, 330), - .DesignXMLNode = s.Site + .DesignXMLNodeName = s.Site } AddHandler f.AddClick, __add AddHandler f.DeleteClick, __delete diff --git a/SCrawler/API/Instagram/SiteSettings.vb b/SCrawler/API/Instagram/SiteSettings.vb index 798eab1..2ddcd00 100644 --- a/SCrawler/API/Instagram/SiteSettings.vb +++ b/SCrawler/API/Instagram/SiteSettings.vb @@ -11,6 +11,7 @@ Imports SCrawler.Plugin Imports SCrawler.Plugin.Attributes Imports PersonalUtilities.Forms Imports PersonalUtilities.Functions.XML +Imports PersonalUtilities.Functions.XML.Objects Imports PersonalUtilities.Functions.XML.Base Imports PersonalUtilities.Functions.RegularExpressions Imports PersonalUtilities.Tools.Web.Clients @@ -237,12 +238,12 @@ Namespace API.Instagram TaggedNotifyLimit = New PropertyValue(200) TaggedNotifyLimitProvider = New TaggedNotifyLimitChecker - DownloadingErrorDate = New XMLValue(Of Date) With {.Provider = New XMLValueConversionProvider(Function(ss, vv) AConvert(Of String)(vv, AModes.Var, Nothing))} + DownloadingErrorDate = New XMLValue(Of Date) With {.Provider = New XMLValueConversionProvider(Function(ss, nn, vv, dd) AConvert(Of String)(vv, AModes.Var, Nothing))} DownloadingErrorDate.SetExtended("InstagramDownloadingErrorDate", Now.AddYears(-10), _XML, n) LastDownloadDate = New XMLValue(Of Date)("LastDownloadDate", Now.AddDays(-1), _XML, n) LastRequestsCount = New XMLValue(Of Integer)("LastRequestsCount", 0, _XML, n) LastRequestsCountLabel = New PropertyValue(LastRequestsCountLabelStr.Invoke(LastRequestsCount.Value)) - AddHandler LastRequestsCount.OnValueChanged, Sub(sender, __name, __value) LastRequestsCountLabel.Value = LastRequestsCountLabelStr.Invoke(DirectCast(__value, Existable(Of Integer)).Value) + AddHandler LastRequestsCount.ValueChanged, Sub(sender, e) LastRequestsCountLabel.Value = LastRequestsCountLabelStr.Invoke(DirectCast(sender, XMLValue(Of Integer)).ValueF.Value) UrlPatternUser = "https://www.instagram.com/{0}/" UserRegex = RParams.DMS("[htps:/]{7,8}.*?instagram.com/([^/]+)", 1) diff --git a/SCrawler/Channels/ChannelViewForm.vb b/SCrawler/Channels/ChannelViewForm.vb index ae93d47..b9268c7 100644 --- a/SCrawler/Channels/ChannelViewForm.vb +++ b/SCrawler/Channels/ChannelViewForm.vb @@ -211,8 +211,8 @@ Friend Class ChannelViewForm : Implements IChannelLimits New ToolStripSeparator, New ToolStripControlHost(CH_HIDE_EXISTS_USERS), BTT_SHOW_STATS}) - AddHandler Settings.ChannelsImagesColumns.OnValueChanged, AddressOf ImagesCountChanged - AddHandler Settings.ChannelsImagesRows.OnValueChanged, AddressOf ImagesCountChanged + AddHandler Settings.ChannelsImagesColumns.ValueChanged, AddressOf ImagesCountChanged + AddHandler Settings.ChannelsImagesRows.ValueChanged, AddressOf ImagesCountChanged End Sub #End Region #Region "Form handlers" @@ -398,7 +398,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits End With Return s End Function - Private Sub ImagesCountChanged(ByVal Sender As Object, ByVal _Name As String, ByVal _Value As Object) + Private Sub ImagesCountChanged(ByVal Sender As Object, ByVal e As EventArgs) AppendPendingUsers() MyRange.Limit = ImagesInRow * ImagesRows MyRange.GoTo(0) diff --git a/SCrawler/Download/Feed/FeedMedia.vb b/SCrawler/Download/Feed/FeedMedia.vb index 406c04f..b684649 100644 --- a/SCrawler/Download/Feed/FeedMedia.vb +++ b/SCrawler/Download/Feed/FeedMedia.vb @@ -6,7 +6,6 @@ ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY -'Imports System.Windows.Forms.PropertyGridInternal Imports System.ComponentModel Imports SCrawler.API.Base Imports PersonalUtilities.Forms diff --git a/SCrawler/Editors/SiteDefaults.vb b/SCrawler/Editors/SiteDefaults.vb index 12e2801..ee96a9a 100644 --- a/SCrawler/Editors/SiteDefaults.vb +++ b/SCrawler/Editors/SiteDefaults.vb @@ -101,7 +101,7 @@ Namespace Editors SetChecker(CH.MyImagesDown, h.DownloadImages) SetChecker(CH.MyVideosDown, h.DownloadVideos) End Sub - Private Overloads Shared Sub SetChecker(ByRef State As CheckState, ByVal Prop As XML.Base.XMLValue(Of Boolean)) + Private Overloads Shared Sub SetChecker(ByRef State As CheckState, ByVal Prop As XML.Objects.XMLValue(Of Boolean)) If Prop.ValueF.Exists Then State = If(Prop.Value, CheckState.Checked, CheckState.Unchecked) Else @@ -113,7 +113,7 @@ Namespace Editors SetPropByChecker(CH.MyImagesDown, h.DownloadImages) SetPropByChecker(CH.MyVideosDown, h.DownloadVideos) End Sub - Private Overloads Shared Sub SetPropByChecker(ByVal State As CheckState, ByRef Prop As XML.Base.XMLValue(Of Boolean)) + Private Overloads Shared Sub SetPropByChecker(ByVal State As CheckState, ByRef Prop As XML.Objects.XMLValue(Of Boolean)) Select Case State Case CheckState.Checked : Prop.Value = True Case CheckState.Unchecked : Prop.Value = False diff --git a/SCrawler/LabelsKeeper.vb b/SCrawler/LabelsKeeper.vb index 6302478..d37f706 100644 --- a/SCrawler/LabelsKeeper.vb +++ b/SCrawler/LabelsKeeper.vb @@ -7,7 +7,7 @@ ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY Imports PersonalUtilities.Functions.XML -Imports PersonalUtilities.Functions.XML.Base +Imports PersonalUtilities.Functions.XML.Objects Imports PersonalUtilities.Tools Friend Class LabelsKeeper : Implements ICollection(Of String), IMyEnumerator(Of String), IDisposable Friend Event NewLabelAdded() @@ -29,8 +29,8 @@ Friend Class LabelsKeeper : Implements ICollection(Of String), IMyEnumerator(Of LabelsList = New List(Of String) NewLabels = New List(Of String) If LabelsFile.Exists Then LabelsList.ListAddList(IO.File.ReadAllLines(LabelsFile), LAP.NotContainsOnly) - Current = New XMLValuesCollection(Of String)(XMLValueBase.ListModes.String, "LatestSelectedLabels", x) With {.ListAddParameters = LAP.NotContainsOnly} - Excluded = New XMLValuesCollection(Of String)(XMLValueBase.ListModes.String, "LatestExcludedLabels", x) With {.ListAddParameters = LAP.NotContainsOnly} + Current = New XMLValuesCollection(Of String)(IXMLValuesCollection.Modes.String, "LatestSelectedLabels",, x) With {.ListAddParameters = LAP.NotContainsOnly} + Excluded = New XMLValuesCollection(Of String)(IXMLValuesCollection.Modes.String, "LatestExcludedLabels",, x) With {.ListAddParameters = LAP.NotContainsOnly} ExcludedIgnore = New XMLValue(Of Boolean)("LatestExcludedLabelsIgnore", False, x) Dim lp As New ListAddParams(LAP.NotContainsOnly + LAP.IgnoreICopier) If Current.Count > 0 Then LabelsList.ListAddList(Current, lp) diff --git a/SCrawler/MainFrame.vb b/SCrawler/MainFrame.vb index 6392492..bca82a2 100644 --- a/SCrawler/MainFrame.vb +++ b/SCrawler/MainFrame.vb @@ -613,7 +613,7 @@ CloseResume: BTT_SHOW_EXCLUDED_LABELS.Checked = Settings.Labels.Excluded.Count > 0 BTT_SHOW_EXCLUDED_LABELS_IGNORE.Checked = Settings.Labels.ExcludedIgnore End Sub - Private Function OpenLabelsForm(ByRef ll As XML.Base.XMLValuesCollection(Of String)) As Boolean + Private Function OpenLabelsForm(ByRef ll As XML.Objects.XMLValuesCollection(Of String)) As Boolean Using f As New LabelsForm(ll) With {.WithDeleteButton = True} f.ShowDialog() If f.DialogResult = DialogResult.OK Then diff --git a/SCrawler/MainMod.vb b/SCrawler/MainMod.vb index 3f0556b..40b2587 100644 --- a/SCrawler/MainMod.vb +++ b/SCrawler/MainMod.vb @@ -7,7 +7,7 @@ ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY Imports System.Runtime.CompilerServices -Imports PersonalUtilities.Functions.XML.Base +Imports PersonalUtilities.Functions.XML.Objects Imports PersonalUtilities.Functions.RegularExpressions Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Tools diff --git a/SCrawler/PluginsEnvironment/Hosts/PluginHost.vb b/SCrawler/PluginsEnvironment/Hosts/PluginHost.vb index d24b947..f6f08d5 100644 --- a/SCrawler/PluginsEnvironment/Hosts/PluginHost.vb +++ b/SCrawler/PluginsEnvironment/Hosts/PluginHost.vb @@ -9,7 +9,7 @@ Imports System.Reflection Imports SCrawler.Plugin.Attributes Imports PersonalUtilities.Functions.XML -Imports PersonalUtilities.Functions.XML.Base +Imports PersonalUtilities.Functions.XML.Objects Imports PersonalUtilities.Tools.WEB.GitHub Namespace Plugin.Hosts Friend Class PluginHost diff --git a/SCrawler/PluginsEnvironment/Hosts/PropertyValueHost.vb b/SCrawler/PluginsEnvironment/Hosts/PropertyValueHost.vb index 0fc4edc..6ade9d0 100644 --- a/SCrawler/PluginsEnvironment/Hosts/PropertyValueHost.vb +++ b/SCrawler/PluginsEnvironment/Hosts/PropertyValueHost.vb @@ -9,6 +9,7 @@ Imports System.Reflection Imports SCrawler.Plugin.Attributes Imports PersonalUtilities.Functions.XML.Base +Imports PersonalUtilities.Functions.XML.Objects Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms.Controls Imports PersonalUtilities.Forms.Controls.Base @@ -200,7 +201,7 @@ Namespace Plugin.Hosts Options = Member.GetCustomAttribute(Of PropertyOption)() IsTaskCounter = Not Member.GetCustomAttribute(Of TaskCounter)() Is Nothing _XmlName = If(Member.GetCustomAttribute(Of PXML)()?.ElementName, String.Empty) - If Not _XmlName.IsEmptyString Then XValue = XMLValueBase.CreateInstance([Type]) + If Not _XmlName.IsEmptyString Then XValue = CreateXMLValueInstance([Type], True) Exists = True End If End Sub diff --git a/SCrawler/PluginsEnvironment/Hosts/SettingsHost.vb b/SCrawler/PluginsEnvironment/Hosts/SettingsHost.vb index 0bd7ce8..d9c5c1b 100644 --- a/SCrawler/PluginsEnvironment/Hosts/SettingsHost.vb +++ b/SCrawler/PluginsEnvironment/Hosts/SettingsHost.vb @@ -11,6 +11,7 @@ Imports SCrawler.API.Base Imports SCrawler.Plugin.Attributes Imports PersonalUtilities.Functions.XML Imports PersonalUtilities.Functions.XML.Base +Imports PersonalUtilities.Functions.XML.Objects Imports PersonalUtilities.Tools.Web.Clients Imports Download = SCrawler.Plugin.ISiteSettings.Download Namespace Plugin.Hosts @@ -251,8 +252,8 @@ Namespace Plugin.Hosts End If End If - _Path = New XMLValue(Of SFile)("Path",, _XML, n, New XMLValueBase.ToFilePath) - _SavedPostsPath = New XMLValue(Of SFile)("SavedPostsPath",, _XML, n, New XMLValueBase.ToFilePath) + _Path = New XMLValue(Of SFile)("Path",, _XML, n, New XMLToFilePathProvider) + _SavedPostsPath = New XMLValue(Of SFile)("SavedPostsPath",, _XML, n, New XMLToFilePathProvider) Temporary = New XMLValue(Of Boolean) Temporary.SetExtended("Temporary", False, _XML, n) diff --git a/SCrawler/SettingsCLS.vb b/SCrawler/SettingsCLS.vb index 72ec4bf..3244e2c 100644 --- a/SCrawler/SettingsCLS.vb +++ b/SCrawler/SettingsCLS.vb @@ -9,6 +9,7 @@ Imports PersonalUtilities.Functions.Messaging Imports PersonalUtilities.Functions.XML Imports PersonalUtilities.Functions.XML.Base +Imports PersonalUtilities.Functions.XML.Objects Imports PersonalUtilities.Forms.Controls Imports PersonalUtilities.Forms.Controls.Base Imports SCrawler.API @@ -91,8 +92,8 @@ Friend Class SettingsCLS : Implements IDisposable End If GlobalPath = New XMLValue(Of SFile)("GlobalPath", New SFile($"{SFile.GetPath(Application.StartupPath).PathWithSeparator}Data\"), MyXML,, - New XMLValueBase.ToFilePath) - LastCopyPath = New XMLValue(Of SFile)("LastCopyPath",, MyXML,, New XMLValueBase.ToFilePath) + New XMLToFilePathProvider) + LastCopyPath = New XMLValue(Of SFile)("LastCopyPath",, MyXML,, New XMLToFilePathProvider) CookiesEncrypted = New XMLValue(Of Boolean)("CookiesEncrypted", False, MyXML) EncryptCookies.CookiesEncrypted = CookiesEncrypted @@ -129,7 +130,7 @@ Friend Class SettingsCLS : Implements IDisposable DownloadOpenProgress = New XMLValueAttribute(Of Boolean, Boolean)("DownloadOpenProgress", "OpenAgain", False, False, MyXML) DownloadsCompleteCommand = New XMLValueAttribute(Of String, Boolean)("DownloadsCompleteCommand", "Use",,, MyXML) ClosingCommand = New XMLValueAttribute(Of String, Boolean)("ClosingCommand", "Use",,, MyXML) - AddHandler ClosingCommand.OnValueChanged, Sub(s, __n, v) MainFrameObj?.ChangeCloseVisible() + AddHandler ClosingCommand.ValueChanged, Sub(s, ev) MainFrameObj?.ChangeCloseVisible() InfoViewMode = New XMLValue(Of Integer)("InfoViewMode", DownloadedInfoForm.ViewModes.Session, MyXML) ViewMode = New XMLValue(Of Integer)("ViewMode", ViewModes.IconLarge, MyXML) ShowingMode = New XMLValue(Of Integer)("ShowingMode", ShowingModes.All, MyXML) @@ -140,7 +141,7 @@ Friend Class SettingsCLS : Implements IDisposable AddMissingToLog = New XMLValue(Of Boolean)("AddMissingToLog", True, MyXML) AddMissingErrorsToLog = New XMLValue(Of Boolean)("AddMissingErrorsToLog", False, MyXML) - LatestSavingPath = New XMLValue(Of SFile)("LatestSavingPath", Nothing, MyXML,, New XMLValueBase.ToFilePath) + LatestSavingPath = New XMLValue(Of SFile)("LatestSavingPath", Nothing, MyXML,, New XMLToFilePathProvider) LatestSelectedChannel = New XMLValue(Of String)("LatestSelectedChannel",, MyXML) _ViewDateFrom = New XMLValue(Of Date) @@ -149,9 +150,9 @@ Friend Class SettingsCLS : Implements IDisposable _ViewDateTo.SetExtended("ViewDateTo",, MyXML) ViewDateMode = New XMLValue(Of Integer)("ViewDateMode", ShowingDates.Off, MyXML) - LatestDownloadedSites = New XMLValuesCollection(Of String)(XMLValueBase.ListModes.String, "LatestDownloadedSites", MyXML) + LatestDownloadedSites = New XMLValuesCollection(Of String)(IXMLValuesCollection.Modes.String, "LatestDownloadedSites",, MyXML) - SelectedSites = New XMLValuesCollection(Of String)(XMLValueBase.ListModes.String, "SelectedSites", MyXML, {Name_Node_Sites}) + SelectedSites = New XMLValuesCollection(Of String)(IXMLValuesCollection.Modes.String, "SelectedSites",, MyXML, {Name_Node_Sites}) ImgurClientID = New XMLValue(Of String)("ImgurClientID", String.Empty, MyXML, {Name_Node_Sites}) @@ -183,11 +184,11 @@ Friend Class SettingsCLS : Implements IDisposable n = {"Users", "FileName"} MaxUsersJobsCount = New XMLValue(Of Integer)("MaxJobsCount", DefaultMaxDownloadingTasks, MyXML, n) FileAddDateToFileName = New XMLValue(Of Boolean)("FileAddDateToFileName", False, MyXML, n) - AddHandler FileAddDateToFileName.OnValueChanged, AddressOf ChangeDateProvider + AddHandler FileAddDateToFileName.ValueChanged, AddressOf ChangeDateProvider FileAddTimeToFileName = New XMLValue(Of Boolean)("FileAddTimeToFileName", False, MyXML, n) - AddHandler FileAddTimeToFileName.OnValueChanged, AddressOf ChangeDateProvider + AddHandler FileAddTimeToFileName.ValueChanged, AddressOf ChangeDateProvider FileDateTimePositionEnd = New XMLValue(Of Boolean)("FileDateTimePositionEnd", True, MyXML, n) - AddHandler FileDateTimePositionEnd.OnValueChanged, AddressOf ChangeDateProvider + AddHandler FileDateTimePositionEnd.ValueChanged, AddressOf ChangeDateProvider FileReplaceNameByDate = New XMLValue(Of Integer)("FileReplaceNameByDate", FileNameReplaceMode.None, MyXML, n) CheckUpdatesAtStart = New XMLValue(Of Boolean)("CheckUpdatesAtStart", True, MyXML) @@ -219,9 +220,9 @@ Friend Class SettingsCLS : Implements IDisposable If BlackList.Count > 0 Then BlackList.RemoveAll(Function(b) Not b.Exists) End If _UpdatesSuspended = False - ChangeDateProvider(Nothing, Nothing, Nothing) + ChangeDateProvider(Nothing, Nothing) End Sub - Private Sub ChangeDateProvider(ByVal Sender As Object, ByVal Name As String, ByVal Value As Object) + Private Sub ChangeDateProvider(ByVal Sender As Object, ByVal e As EventArgs) If Not _UpdatesSuspended Then Dim p$ = String.Empty If FileAddDateToFileName Then p = "yyyyMMdd" @@ -506,7 +507,7 @@ Friend Class SettingsCLS : Implements IDisposable MyXML.EndUpdate() If MyXML.ChangesDetected Then MyXML.UpdateData() _UpdatesSuspended = False - ChangeDateProvider(Nothing, Nothing, Nothing) + ChangeDateProvider(Nothing, Nothing) End Sub Default Friend ReadOnly Property Site(ByVal PluginKey As String) As SettingsHost Get