implements idispatch interface

This commit is contained in:
xieguigang 2022-10-24 20:21:58 +08:00
parent b037e2b809
commit 2b77b1addc
4 changed files with 151 additions and 124 deletions

View File

@ -1,62 +1,65 @@
#Region "Microsoft.VisualBasic::204e09ebeaac170c1afe111ad2ba299c, sciBASIC#\Microsoft.VisualBasic.Core\src\ApplicationServices\Debugger\Exception\ExceptionData.vb"
' Author:
'
' asuka (amethyst.asuka@gcmodeller.org)
' xie (genetics@smrucc.org)
' xieguigang (xie.guigang@live.com)
'
' Copyright (c) 2018 GPL3 Licensed
'
'
' GNU GENERAL PUBLIC LICENSE (GPL3)
'
'
' 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; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.
' Author:
'
' asuka (amethyst.asuka@gcmodeller.org)
' xie (genetics@smrucc.org)
' xieguigang (xie.guigang@live.com)
'
' Copyright (c) 2018 GPL3 Licensed
'
'
' GNU GENERAL PUBLIC LICENSE (GPL3)
'
'
' 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; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.
' /********************************************************************************/
' /********************************************************************************/
' Summaries:
' Summaries:
' Code Statistics:
' Code Statistics:
' Total Lines: 82
' Code Lines: 59
' Comment Lines: 12
' Blank Lines: 11
' File Size: 3.05 KB
' Total Lines: 82
' Code Lines: 59
' Comment Lines: 12
' Blank Lines: 11
' File Size: 3.05 KB
' Class ExceptionData
'
' Properties: Message, Source, StackTrace, TypeFullName
'
' Function: CreateFromObject, CreateInstance, Exception, GetCurrentStackTrace, getMessages
' ParseStackTrace, ToString
'
'
' /********************************************************************************/
' Class ExceptionData
'
' Properties: Message, Source, StackTrace, TypeFullName
'
' Function: CreateFromObject, CreateInstance, Exception, GetCurrentStackTrace, getMessages
' ParseStackTrace, ToString
'
'
' /********************************************************************************/
#End Region
Imports System.Runtime.InteropServices
Imports Microsoft.VisualBasic.Text
Namespace ApplicationServices.Debugging.Diagnostics
<ClassInterface(ClassInterfaceType.AutoDual)>
<ComVisible(True)>
Public Class ExceptionData
Public Property TypeFullName As String
@ -68,6 +71,9 @@ Namespace ApplicationServices.Debugging.Diagnostics
Public Property Source As String
Public Property StackTrace As StackFrame()
Sub New()
End Sub
''' <summary>
''' Create exception object for throw exception expression
''' </summary>

View File

@ -1,60 +1,64 @@
#Region "Microsoft.VisualBasic::4be2c6aed1bae45a0ef0d6f229ed811e, sciBASIC#\Microsoft.VisualBasic.Core\src\ApplicationServices\Debugger\Exception\MethodFrame.vb"
' Author:
'
' asuka (amethyst.asuka@gcmodeller.org)
' xie (genetics@smrucc.org)
' xieguigang (xie.guigang@live.com)
'
' Copyright (c) 2018 GPL3 Licensed
'
'
' GNU GENERAL PUBLIC LICENSE (GPL3)
'
'
' 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; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.
' Author:
'
' asuka (amethyst.asuka@gcmodeller.org)
' xie (genetics@smrucc.org)
' xieguigang (xie.guigang@live.com)
'
' Copyright (c) 2018 GPL3 Licensed
'
'
' GNU GENERAL PUBLIC LICENSE (GPL3)
'
'
' 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; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.
' /********************************************************************************/
' /********************************************************************************/
' Summaries:
' Summaries:
' Code Statistics:
' Code Statistics:
' Total Lines: 24
' Code Lines: 18
' Comment Lines: 0
' Blank Lines: 6
' File Size: 628 B
' Total Lines: 24
' Code Lines: 18
' Comment Lines: 0
' Blank Lines: 6
' File Size: 628 B
' Class Method
'
' Properties: [Module], [Namespace], Method
'
' Constructor: (+2 Overloads) Sub New
' Function: ToString
'
'
' /********************************************************************************/
' Class Method
'
' Properties: [Module], [Namespace], Method
'
' Constructor: (+2 Overloads) Sub New
' Function: ToString
'
'
' /********************************************************************************/
#End Region
Imports System.Runtime.InteropServices
Namespace ApplicationServices.Debugging.Diagnostics
<ClassInterface(ClassInterfaceType.AutoDual)>
<ComVisible(True)>
Public Class Method
Public Property [Namespace] As String

View File

@ -1,58 +1,59 @@
#Region "Microsoft.VisualBasic::b1dcca44b61f51f96039a76ff90db4fa, sciBASIC#\Microsoft.VisualBasic.Core\src\ApplicationServices\Debugger\Exception\StackFrame.vb"
' Author:
'
' asuka (amethyst.asuka@gcmodeller.org)
' xie (genetics@smrucc.org)
' xieguigang (xie.guigang@live.com)
'
' Copyright (c) 2018 GPL3 Licensed
'
'
' GNU GENERAL PUBLIC LICENSE (GPL3)
'
'
' 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; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.
' Author:
'
' asuka (amethyst.asuka@gcmodeller.org)
' xie (genetics@smrucc.org)
' xieguigang (xie.guigang@live.com)
'
' Copyright (c) 2018 GPL3 Licensed
'
'
' GNU GENERAL PUBLIC LICENSE (GPL3)
'
'
' 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; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.
' /********************************************************************************/
' /********************************************************************************/
' Summaries:
' Summaries:
' Code Statistics:
' Code Statistics:
' Total Lines: 95
' Code Lines: 62
' Comment Lines: 21
' Blank Lines: 12
' File Size: 3.10 KB
' Total Lines: 95
' Code Lines: 62
' Comment Lines: 21
' Blank Lines: 12
' File Size: 3.10 KB
' Class StackFrame
'
' Properties: File, Line, Method
'
' Constructor: (+2 Overloads) Sub New
' Function: FromUnknownLocation, Parser, parserImpl, ToString
'
'
' /********************************************************************************/
' Class StackFrame
'
' Properties: File, Line, Method
'
' Constructor: (+2 Overloads) Sub New
' Function: FromUnknownLocation, Parser, parserImpl, ToString
'
'
' /********************************************************************************/
#End Region
Imports System.Runtime.InteropServices
Imports Microsoft.VisualBasic.Linq
Namespace ApplicationServices.Debugging.Diagnostics
@ -61,6 +62,9 @@ Namespace ApplicationServices.Debugging.Diagnostics
''' Contains the necessary function calls information, source
''' file location information for traceback the runtime error
''' </summary>
'''
<ClassInterface(ClassInterfaceType.AutoDual)>
<ComVisible(True)>
Public Class StackFrame
''' <summary>

View File

@ -307,9 +307,22 @@ Namespace ComponentModel.Settings
Return profilesData.FilePath
End Function
''' <summary>
''' save the settings data in xml file format
''' </summary>
''' <param name="FilePath"></param>
''' <param name="Encoding"></param>
''' <returns></returns>
<ExportAPI("Save")>
Public Function Save(FilePath$, Encoding As Encoding) As Boolean Implements ISaveHandle.Save
Dim Xml As String = profilesData.GetXml
' 20221022
'
' due to the reason of profilesData object is
' an interface, then getxml on this interface
' will throw exceptions, change the getxml extension
' to the object general function to fix
' this error
Dim xml As String = XmlExtensions.GetXml(profilesData, profilesData.GetType(), throwEx:=False)
Return Xml.SaveTo(FilePath Or Me.FilePath.When(FilePath.StringEmpty), Encoding)
End Function