コード例 #1
0
ファイル: Student.cs プロジェクト: dzas/TelerikAcademy2016
        public object Clone()
        {
            var firstName   = (string)FirstName.Clone();
            var middleName  = (string)MiddleName.Clone();
            var lastName    = (string)LastName.Clone();
            var mobilePhone = (string)MobilePhone.Clone();
            var email       = (string)Email.Clone();
            var address     = (string)Address.Clone();
            var ssn         = (string)Ssn.Clone();

            return(new Student(firstName, middleName, lastName, ssn, address, mobilePhone, email, Course, Speciality,
                               University, Faculty));
        }
コード例 #2
0
        /// <summary>
        /// Clones the instance using special context and returns cloned instance.
        /// </summary>
        /// <param name="context">Special context for providing references continuity.</param>
        /// <returns>Cloned instance.</returns>
        public UseRawStatement Clone(Dictionary <object, object> context)
        {
            if (context.ContainsKey(this))
            {
                return((UseRawStatement)context[this]);
            }

            var result = new UseRawStatement();

            context[this] = result;

            result.KindOfUseRawStatement = KindOfUseRawStatement;
            result.FirstName             = FirstName?.Clone(context);
            result.SecondName            = SecondName?.Clone(context);
            result.Rank   = Rank?.CloneValue(context);
            result.HasNot = HasNot;

            result.AppendAnnotations(this, context);

            return(result);
        }
コード例 #3
0
 public new Employee DeepCopy()
 {
     return(new Employee((string)FirstName.Clone(), (string)LastName.Clone(), Address.DeepCopy(), Salary));
 }