protected void Copy(UserData obj, bool full) { obj.UserId = UserId; obj.ServerId = ServerId; obj.UserSecId = UserSecId; obj.RemoteVersion = RemoteVersion; obj.Prefix = Prefix; obj.ProductId = ProductId; if (full) { // Deep copy obj.Domain = String.Copy(Domain); obj.UserName = String.Copy(UserName); obj.LicenseLanguages = new List<CrossLanguageDescriptor>(LicenseLanguages); } else { // Copy references obj.Domain = Domain; obj.UserName = UserName; obj._licenseLanguages = _licenseLanguages; } }
/// <summary> /// Create copy of object: /// 'full' is true (not supported now): full copy /// 'full' is false: create only object's copy, inner fields will be presented as references /// </summary> public UserData Copy(bool full) { UserData copy = new UserData(); Copy(copy, full); return copy; }