正在阅读:.Net进阶:实现Prototype设计模式.Net进阶:实现Prototype设计模式

2004-05-28 10:23 出处:CSDN 作者:guoyan19811021(翻译) 责任编辑:linjixiong


       Dim intCount As Integer

        Dim objEmp As CEmp

        ArrEmp = New ArrayList

        intCount = CInt(info.GetValue("emp_count", GetType(String)))

        For intIndex = 0 To intCount - 1

            objEmp = New CEmp(info, context, intIndex)

            ArrEmp.Add(objEmp)

        Next

    End Sub

    Public Function Clone() As Object Implements ICloneable.Clone

        Try

            Return Me

        Catch ex As Exception

            MsgBox(ex.ToString)

        End Try

    End Function

    Public Function Clone(ByVal Deep As Boolean) As Object

        Try

            If Deep Then

                Return CreateDeepCopy()

            Else

                Return Clone()

            End If

        Catch ex As Exception

            MsgBox(ex.ToString)

        End Try

    End Function

    Private Function CreateDeepCopy() As CEmpData

        Dim objEmpCopy As CEmpData

        Dim objStream As Stream

 


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:

键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品