VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsBMShape"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Private Const m_cNAME As String = "clsBMShape"

'Constant used for serializing and deserializing this character
Private Const m_cShapeSep As String = "[S ¶]"

Public m_sGUID As String
Public m_nType As Long
Public m_nX1 As Double
Public m_nY1 As Double
Public m_nX2 As Double
Public m_nY2 As Double
Public m_nBorderColor As Long
Public m_nFillColor As Long
Public m_nWidth As Long

Public Function Name() As String
  
    On Error GoTo ErrorHandler
    Dim sRoutineName As String
    sRoutineName = m_cNAME & ".Name"
    Call WriteProcStart(sRoutineName)
    
    
    Name = m_cNAME
    

    Call WriteProcStop(sRoutineName)
    'Exit the sub... on an error we will jump over this function
    Exit Function
ErrorHandler:
    Call LogErrorToFile(sRoutineName & "." & Err.Description): Call g_oErrors.HandleErrorWithSource(Err, sRoutineName): Call g_oErrors.DisplayErrorCount
    
End Function

Private Sub Class_Initialize()
  
    On Error GoTo ErrorHandler
    Dim sRoutineName As String
    sRoutineName = m_cNAME & ".Class_Initialize"
    Call WriteProcStart(sRoutineName)
    
    
    m_sGUID = GetGUID("BMShape")


    Call WriteProcStop(sRoutineName)
    'Exit the sub... on an error we will jump over this function
    Exit Sub
ErrorHandler:
    Call LogErrorToFile(sRoutineName & "." & Err.Description): Call g_oErrors.HandleErrorWithSource(Err, sRoutineName): Call g_oErrors.DisplayErrorCount
    
End Sub
Public Function Serialize() As String

    On Error GoTo ErrorHandler
    Dim sRoutineName As String
    sRoutineName = m_cNAME & ".Serialize"
    Call WriteProcStart(sRoutineName)
    
    
    Serialize = m_sGUID & m_cShapeSep
    Serialize = Serialize & m_nType & m_cShapeSep
    Serialize = Serialize & m_nX1 & m_cShapeSep
    Serialize = Serialize & m_nY1 & m_cShapeSep
    Serialize = Serialize & m_nX2 & m_cShapeSep
    Serialize = Serialize & m_nY2 & m_cShapeSep
    Serialize = Serialize & m_nBorderColor & m_cShapeSep
    Serialize = Serialize & m_nFillColor & m_cShapeSep
    Serialize = Serialize & m_nWidth & m_cShapeSep
    
    
    Call WriteProcStop(sRoutineName) ' Serialize)
    'Exit the sub... on an error we will jump over this function
    Exit Function
ErrorHandler:
    Call LogErrorToFile(sRoutineName & "." & Err.Description): Call g_oErrors.HandleErrorWithSource(Err, sRoutineName): Call g_oErrors.DisplayErrorCount
    
End Function
Public Function DeSerialize(sShape As String) As String

    On Error GoTo ErrorHandler
    Dim sRoutineName As String
    sRoutineName = m_cNAME & ".DeSerialize"
    Call WriteProcStart(sRoutineName) ' sShape)


    Dim sRemStr As String
    sRemStr = sShape
    
    m_sGUID = Left(sRemStr, InStr(sRemStr, m_cShapeSep) - 1)
        sRemStr = Right(sRemStr, Len(sRemStr) - InStr(sRemStr, m_cShapeSep) - Len(m_cShapeSep) + 1)
    m_nType = Left(sRemStr, InStr(sRemStr, m_cShapeSep) - 1)
        sRemStr = Right(sRemStr, Len(sRemStr) - InStr(sRemStr, m_cShapeSep) - Len(m_cShapeSep) + 1)
    m_nX1 = Left(sRemStr, InStr(sRemStr, m_cShapeSep) - 1)
        sRemStr = Right(sRemStr, Len(sRemStr) - InStr(sRemStr, m_cShapeSep) - Len(m_cShapeSep) + 1)
    m_nY1 = Left(sRemStr, InStr(sRemStr, m_cShapeSep) - 1)
        sRemStr = Right(sRemStr, Len(sRemStr) - InStr(sRemStr, m_cShapeSep) - Len(m_cShapeSep) + 1)
    m_nX2 = Left(sRemStr, InStr(sRemStr, m_cShapeSep) - 1)
        sRemStr = Right(sRemStr, Len(sRemStr) - InStr(sRemStr, m_cShapeSep) - Len(m_cShapeSep) + 1)
    m_nY2 = Left(sRemStr, InStr(sRemStr, m_cShapeSep) - 1)
        sRemStr = Right(sRemStr, Len(sRemStr) - InStr(sRemStr, m_cShapeSep) - Len(m_cShapeSep) + 1)
    m_nBorderColor = Left(sRemStr, InStr(sRemStr, m_cShapeSep) - 1)
        sRemStr = Right(sRemStr, Len(sRemStr) - InStr(sRemStr, m_cShapeSep) - Len(m_cShapeSep) + 1)
    m_nFillColor = Left(sRemStr, InStr(sRemStr, m_cShapeSep) - 1)
        sRemStr = Right(sRemStr, Len(sRemStr) - InStr(sRemStr, m_cShapeSep) - Len(m_cShapeSep) + 1)
    m_nWidth = Left(sRemStr, InStr(sRemStr, m_cShapeSep) - 1)
        sRemStr = Right(sRemStr, Len(sRemStr) - InStr(sRemStr, m_cShapeSep) - Len(m_cShapeSep) + 1)

    DeSerialize = sRemStr
    
    
    Call WriteProcStop(sRoutineName) ' sRemStr)
    'Exit the sub... on an error we will jump over this function
    Exit Function
ErrorHandler:
    Call LogErrorToFile(sRoutineName & "." & Err.Description): Call g_oErrors.HandleErrorWithSource(Err, sRoutineName): Call g_oErrors.DisplayErrorCount
    
End Function
