public override void WriteXml(XmlWriter writer) { writer.WriteElementString(RedmineKeys.NAME, Name); writer.WriteElementString(RedmineKeys.IDENTIFIER, Identifier); writer.WriteElementString(RedmineKeys.DESCRIPTION, Description); writer.WriteElementString(RedmineKeys.INHERIT_MEMBERS, InheritMembers.ToString()); writer.WriteElementString(RedmineKeys.IS_PUBLIC, IsPublic.ToString()); writer.WriteIdOrEmpty(Parent, RedmineKeys.PARENT_ID); writer.WriteElementString(RedmineKeys.HOMEPAGE, HomePage); if (Trackers != null) { foreach (var item in Trackers) { writer.WriteElementString(RedmineKeys.TRACKER_IDS, item.Id.ToString()); } } if (EnabledModules != null) { foreach (var item in EnabledModules) { writer.WriteElementString(RedmineKeys.ENABLED_MODULE_NAMES, item.Name); } } if (Id == 0) { return; } writer.WriteArray(CustomFields, RedmineKeys.CUSTOM_FIELDS); }
public override int GetHashCode() { unchecked { var hashCode = (_projectsService != null ? _projectsService.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (_navigationService != null ? _navigationService.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DetailCommand != null ? DetailCommand.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (EditCommand != null ? EditCommand.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Identify != null ? StringComparer.CurrentCulture.GetHashCode(Identify) : 0); hashCode = (hashCode * 397) ^ Id; hashCode = (hashCode * 397) ^ (Name != null ? StringComparer.CurrentCulture.GetHashCode(Name) : 0); hashCode = (hashCode * 397) ^ (Identifier != null ? StringComparer.CurrentCulture.GetHashCode(Identifier) : 0); hashCode = (hashCode * 397) ^ (Description != null ? StringComparer.CurrentCulture.GetHashCode(Description) : 0); hashCode = (hashCode * 397) ^ (Parent != null ? Parent.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (HomePage != null ? StringComparer.CurrentCulture.GetHashCode(HomePage) : 0); hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode(); hashCode = (hashCode * 397) ^ UpdatedOn.GetHashCode(); hashCode = (hashCode * 397) ^ (int)Status; hashCode = (hashCode * 397) ^ IsPublic.GetHashCode(); hashCode = (hashCode * 397) ^ InheritMembers.GetHashCode(); hashCode = (hashCode * 397) ^ (Trackers != null ? Trackers.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CustomFields != null ? CustomFields.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (IssueCategories != null ? IssueCategories.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (EnabledModules != null ? EnabledModules.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TimeEntryActivities != null ? TimeEntryActivities.GetHashCode() : 0); return(hashCode); } }
public override void WriteXml(XmlWriter writer) { writer.WriteElementString("name", Name); writer.WriteElementString("identifier", Identifier); writer.WriteElementString("description", Description); writer.WriteElementString("inherit_members", InheritMembers.ToString()); writer.WriteElementString("is_public", IsPublic.ToString()); writer.WriteIdIfNotNull(Parent, "parent_id"); writer.WriteElementString("homepage", HomePage); if (!string.IsNullOrEmpty(EnabledModuleNames)) { var tokens = EnabledModuleNames.Split( ",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); foreach (var token in tokens) { writer.WriteElementString("enabled_module_names", token); } } if (Id == 0) { return; } if (CustomFields != null) { writer.WriteStartElement("custom_fields"); writer.WriteAttributeString("type", "array"); foreach (var cf in CustomFields) { new XmlSerializer(cf.GetType()).Serialize(writer, cf); } writer.WriteEndElement(); } }
public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (PublicKey != null ? PublicKey.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsPublic.GetHashCode(); return(hashCode); } }
public void GetMessageType(Type[] typeArguments) { var actual = MessageBuilder.GetMessageType(typeArguments); MessageBuilder.GetMessageType(typeArguments).ShouldBe(actual); actual.ShouldNotBeNull(); Activator.CreateInstance(actual).ShouldNotBeNull(); // default ctor actual.GetCustomAttribute <SerializableAttribute>().ShouldNotBeNull(); actual.GetCustomAttribute <DataContractAttribute>().ShouldNotBeNull(); // new (,,,,) actual.Constructor(typeArguments).IsPublic.ShouldBeTrue(); var values = new object[typeArguments.Length]; for (var i = 0; i < typeArguments.Length; i++) { values[i] = "the value " + i; } ////Console.WriteLine(actual.Constructor(typeArguments).Disassemble()); var instance = actual.Constructor(typeArguments).Invoke(values); for (var i = 0; i < typeArguments.Length; i++) { var property = actual.InstanceProperty("Value" + (i + 1)); property.ShouldNotBeNull(); property.PropertyType.ShouldBe(typeArguments[i]); property.GetMethod.ShouldNotBeNull(); property.GetMethod !.IsPublic.ShouldBeTrue(); property.SetMethod.ShouldNotBeNull(); property.SetMethod !.IsPublic.ShouldBeTrue(); if (i == 255) { Console.WriteLine(property.GetMethod.Disassemble()); } property.GetValue(instance).ShouldBe(values[i]); property.SetValue(instance, "new " + values[i]); property.GetValue(instance).ShouldBe("new " + values[i]); var dataMember = property.GetCustomAttribute <DataMemberAttribute>(); dataMember.ShouldNotBeNull(); dataMember !.Name.ShouldBe("v" + (i + 1)); dataMember.Order.ShouldBe(i + 1); } }
/// <summary> /// </summary> /// <param name="writer"></param> public override void WriteXml(System.Xml.XmlWriter writer) { writer.WriteElementString(RedmineKeys.NAME, Name); writer.WriteElementString(RedmineKeys.IDENTIFIER, Identifier); writer.WriteElementString(RedmineKeys.DESCRIPTION, Description); writer.WriteElementString(RedmineKeys.INHERIT_MEMBERS, InheritMembers.ToString().ToLowerInvariant()); writer.WriteElementString(RedmineKeys.IS_PUBLIC, IsPublic.ToString().ToLowerInvariant()); writer.WriteIdOrEmpty(Parent, RedmineKeys.PARENT_ID); writer.WriteElementString(RedmineKeys.HOMEPAGE, HomePage); writer.WriteListElements(Trackers as System.Collections.Generic.List <IValue>, RedmineKeys.TRACKER_IDS); writer.WriteListElements(EnabledModules as System.Collections.Generic.List <IValue>, RedmineKeys.ENABLED_MODULE_NAMES); if (Id == 0) { return; } writer.WriteArray(CustomFields, RedmineKeys.CUSTOM_FIELDS); }
public override int GetHashCode() { unchecked { var hashCode = (Identifier != null ? Identifier.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Parent != null ? Parent.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (HomePage != null ? HomePage.GetHashCode() : 0); hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode(); hashCode = (hashCode * 397) ^ UpdatedOn.GetHashCode(); hashCode = (hashCode * 397) ^ (int)Status; hashCode = (hashCode * 397) ^ IsPublic.GetHashCode(); hashCode = (hashCode * 397) ^ InheritMembers.GetHashCode(); hashCode = (hashCode * 397) ^ (Trackers != null ? Trackers.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CustomFields != null ? CustomFields.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (IssueCategories != null ? IssueCategories.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (EnabledModules != null ? EnabledModules.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TimeEntryActivities != null ? TimeEntryActivities.GetHashCode() : 0); return(hashCode); } }
public override void WriteXml(XmlWriter writer) { writer.WriteElementString("name", Name); writer.WriteElementString("identifier", Identifier); writer.WriteElementString("description", Description); writer.WriteElementString("inherit_members", InheritMembers.ToString()); writer.WriteElementString("is_public", IsPublic.ToString()); writer.WriteIdIfNotNull(Parent, "parent_id"); writer.WriteElementString("homepage", HomePage); if (EnabledModules != null) { var enabledModuleNames = ""; foreach (var projectEnabledModule in EnabledModules) { if (!string.IsNullOrEmpty(projectEnabledModule.Name)) { enabledModuleNames += projectEnabledModule.Name; } } writer.WriteElementString("enabled_module_names", enabledModuleNames); } if (Id == 0) { return; } if (CustomFields != null) { writer.WriteStartElement("custom_fields"); writer.WriteAttributeString("type", "array"); foreach (var cf in CustomFields) { new XmlSerializer(cf.GetType()).Serialize(writer, cf); } writer.WriteEndElement(); } }
public bool Equals(FireteamSummary input) { if (input == null) { return(false); } return (( FireteamId == input.FireteamId || (FireteamId.Equals(input.FireteamId)) ) && ( GroupId == input.GroupId || (GroupId.Equals(input.GroupId)) ) && ( Platform == input.Platform || (Platform != null && Platform.Equals(input.Platform)) ) && ( ActivityType == input.ActivityType || (ActivityType.Equals(input.ActivityType)) ) && ( IsImmediate == input.IsImmediate || (IsImmediate != null && IsImmediate.Equals(input.IsImmediate)) ) && ( ScheduledTime == input.ScheduledTime || (ScheduledTime != null && ScheduledTime.Equals(input.ScheduledTime)) ) && ( OwnerMembershipId == input.OwnerMembershipId || (OwnerMembershipId.Equals(input.OwnerMembershipId)) ) && ( PlayerSlotCount == input.PlayerSlotCount || (PlayerSlotCount.Equals(input.PlayerSlotCount)) ) && ( AlternateSlotCount == input.AlternateSlotCount || (AlternateSlotCount.Equals(input.AlternateSlotCount)) ) && ( AvailablePlayerSlotCount == input.AvailablePlayerSlotCount || (AvailablePlayerSlotCount.Equals(input.AvailablePlayerSlotCount)) ) && ( AvailableAlternateSlotCount == input.AvailableAlternateSlotCount || (AvailableAlternateSlotCount.Equals(input.AvailableAlternateSlotCount)) ) && ( Title == input.Title || (Title != null && Title.Equals(input.Title)) ) && ( DateCreated == input.DateCreated || (DateCreated != null && DateCreated.Equals(input.DateCreated)) ) && ( DateModified == input.DateModified || (DateModified != null && DateModified.Equals(input.DateModified)) ) && ( IsPublic == input.IsPublic || (IsPublic != null && IsPublic.Equals(input.IsPublic)) ) && ( Locale == input.Locale || (Locale != null && Locale.Equals(input.Locale)) ) && ( IsValid == input.IsValid || (IsValid != null && IsValid.Equals(input.IsValid)) ) && ( DatePlayerModified == input.DatePlayerModified || (DatePlayerModified != null && DatePlayerModified.Equals(input.DatePlayerModified)) ) && ( TitleBeforeModeration == input.TitleBeforeModeration || (TitleBeforeModeration != null && TitleBeforeModeration.Equals(input.TitleBeforeModeration)) )); }
public bool Equals(DestinyProfileUserInfoCard input) { if (input == null) { return(false); } return (( DateLastPlayed == input.DateLastPlayed || (DateLastPlayed != null && DateLastPlayed.Equals(input.DateLastPlayed)) ) && ( IsOverridden == input.IsOverridden || (IsOverridden != null && IsOverridden.Equals(input.IsOverridden)) ) && ( IsCrossSavePrimary == input.IsCrossSavePrimary || (IsCrossSavePrimary != null && IsCrossSavePrimary.Equals(input.IsCrossSavePrimary)) ) && ( PlatformSilver == input.PlatformSilver || (PlatformSilver != null && PlatformSilver.Equals(input.PlatformSilver)) ) && ( UnpairedGameVersions == input.UnpairedGameVersions || (UnpairedGameVersions.Equals(input.UnpairedGameVersions)) ) && ( SupplementalDisplayName == input.SupplementalDisplayName || (SupplementalDisplayName != null && SupplementalDisplayName.Equals(input.SupplementalDisplayName)) ) && ( IconPath == input.IconPath || (IconPath != null && IconPath.Equals(input.IconPath)) ) && ( CrossSaveOverride == input.CrossSaveOverride || (CrossSaveOverride != null && CrossSaveOverride.Equals(input.CrossSaveOverride)) ) && ( ApplicableMembershipTypes == input.ApplicableMembershipTypes || (ApplicableMembershipTypes != null && ApplicableMembershipTypes.SequenceEqual(input.ApplicableMembershipTypes)) ) && ( IsPublic == input.IsPublic || (IsPublic != null && IsPublic.Equals(input.IsPublic)) ) && ( MembershipType == input.MembershipType || (MembershipType != null && MembershipType.Equals(input.MembershipType)) ) && ( MembershipId == input.MembershipId || (MembershipId.Equals(input.MembershipId)) ) && ( DisplayName == input.DisplayName || (DisplayName != null && DisplayName.Equals(input.DisplayName)) ) && ( BungieGlobalDisplayName == input.BungieGlobalDisplayName || (BungieGlobalDisplayName != null && BungieGlobalDisplayName.Equals(input.BungieGlobalDisplayName)) ) && ( BungieGlobalDisplayNameCode == input.BungieGlobalDisplayNameCode || (BungieGlobalDisplayNameCode.Equals(input.BungieGlobalDisplayNameCode)) )); }
public bool HaveColumn(string columnName, string columnValue, out bool retValueMatched) { bool ret = false; bool valueMatched = false; if (columnName == "InfoPageID") { ret = true; if (InfoPageID.ToString() == columnValue) { valueMatched = true; } } if (columnName == "InfoPageGUID") { ret = true; if (InfoPageGUID.ToString() == columnValue) { valueMatched = true; } } if (columnName == "RevisionNo") { ret = true; if (RevisionNo.ToString() == columnValue) { valueMatched = true; } } if (columnName == "UserID") { ret = true; if (UserID.ToString() == columnValue) { valueMatched = true; } } if (columnName == "UserGUID") { ret = true; if (UserGUID.ToString() == columnValue) { valueMatched = true; } } if (columnName == "CreatedDate") { ret = true; if (CreatedDate.ToString() == columnValue) { valueMatched = true; } } if (columnName == "LastUpdateDate") { ret = true; if (LastUpdateDate.ToString() == columnValue) { valueMatched = true; } } if (columnName == "CreatedUserID") { ret = true; if (CreatedUserID.ToString() == columnValue) { valueMatched = true; } } if (columnName == "CreatedUserGUID") { ret = true; if (CreatedUserGUID.ToString() == columnValue) { valueMatched = true; } } if (columnName == "InfoPageName") { ret = true; if (InfoPageName.ToString() == columnValue) { valueMatched = true; } } if (columnName == "InfoPageDescription") { ret = true; if (InfoPageDescription.ToString() == columnValue) { valueMatched = true; } } if (columnName == "InfoCategoryID") { ret = true; if (InfoCategoryID.ToString() == columnValue) { valueMatched = true; } } if (columnName == "InfoCategoryGUID") { ret = true; if (InfoCategoryGUID.ToString() == columnValue) { valueMatched = true; } } if (columnName == "AccessGroupID") { ret = true; if (AccessGroupID.ToString() == columnValue) { valueMatched = true; } } if (columnName == "AccessGroupGUID") { ret = true; if (AccessGroupGUID.ToString() == columnValue) { valueMatched = true; } } if (columnName == "AsyncLoading") { ret = true; if (AsyncLoading.ToString() == columnValue) { valueMatched = true; } } if (columnName == "Commentable") { ret = true; if (Commentable.ToString() == columnValue) { valueMatched = true; } } if (columnName == "CommentorRoleList") { ret = true; if (CommentorRoleList.ToString() == columnValue) { valueMatched = true; } } if (columnName == "CommentorGroupList") { ret = true; if (CommentorGroupList.ToString() == columnValue) { valueMatched = true; } } if (columnName == "CommentorHideRoleList") { ret = true; if (CommentorHideRoleList.ToString() == columnValue) { valueMatched = true; } } if (columnName == "CommentorHideGroupList") { ret = true; if (CommentorHideGroupList.ToString() == columnValue) { valueMatched = true; } } if (columnName == "IsActive") { ret = true; if (IsActive.ToString() == columnValue) { valueMatched = true; } } if (columnName == "ExpiryDate") { ret = true; if (ExpiryDate.ToString() == columnValue) { valueMatched = true; } } if (columnName == "IsCommon") { ret = true; if (IsCommon.ToString() == columnValue) { valueMatched = true; } } if (columnName == "IsPublic") { ret = true; if (IsPublic.ToString() == columnValue) { valueMatched = true; } } if (columnName == "Sequence") { ret = true; if (Sequence.ToString() == columnValue) { valueMatched = true; } } if (columnName == "IsDeleted") { ret = true; if (IsDeleted.ToString() == columnValue) { valueMatched = true; } } retValueMatched = valueMatched; return(ret); }
public bool Equals(GroupV2 input) { if (input == null) { return(false); } return (( GroupId == input.GroupId || (GroupId.Equals(input.GroupId)) ) && ( Name == input.Name || (Name != null && Name.Equals(input.Name)) ) && ( GroupType == input.GroupType || (GroupType != null && GroupType.Equals(input.GroupType)) ) && ( MembershipIdCreated == input.MembershipIdCreated || (MembershipIdCreated.Equals(input.MembershipIdCreated)) ) && ( CreationDate == input.CreationDate || (CreationDate != null && CreationDate.Equals(input.CreationDate)) ) && ( ModificationDate == input.ModificationDate || (ModificationDate != null && ModificationDate.Equals(input.ModificationDate)) ) && ( About == input.About || (About != null && About.Equals(input.About)) ) && ( Tags == input.Tags || (Tags != null && Tags.SequenceEqual(input.Tags)) ) && ( MemberCount == input.MemberCount || (MemberCount.Equals(input.MemberCount)) ) && ( IsPublic == input.IsPublic || (IsPublic != null && IsPublic.Equals(input.IsPublic)) ) && ( IsPublicTopicAdminOnly == input.IsPublicTopicAdminOnly || (IsPublicTopicAdminOnly != null && IsPublicTopicAdminOnly.Equals(input.IsPublicTopicAdminOnly)) ) && ( Motto == input.Motto || (Motto != null && Motto.Equals(input.Motto)) ) && ( AllowChat == input.AllowChat || (AllowChat != null && AllowChat.Equals(input.AllowChat)) ) && ( IsDefaultPostPublic == input.IsDefaultPostPublic || (IsDefaultPostPublic != null && IsDefaultPostPublic.Equals(input.IsDefaultPostPublic)) ) && ( ChatSecurity == input.ChatSecurity || (ChatSecurity != null && ChatSecurity.Equals(input.ChatSecurity)) ) && ( Locale == input.Locale || (Locale != null && Locale.Equals(input.Locale)) ) && ( AvatarImageIndex == input.AvatarImageIndex || (AvatarImageIndex.Equals(input.AvatarImageIndex)) ) && ( Homepage == input.Homepage || (Homepage != null && Homepage.Equals(input.Homepage)) ) && ( MembershipOption == input.MembershipOption || (MembershipOption != null && MembershipOption.Equals(input.MembershipOption)) ) && ( DefaultPublicity == input.DefaultPublicity || (DefaultPublicity != null && DefaultPublicity.Equals(input.DefaultPublicity)) ) && ( Theme == input.Theme || (Theme != null && Theme.Equals(input.Theme)) ) && ( BannerPath == input.BannerPath || (BannerPath != null && BannerPath.Equals(input.BannerPath)) ) && ( AvatarPath == input.AvatarPath || (AvatarPath != null && AvatarPath.Equals(input.AvatarPath)) ) && ( ConversationId == input.ConversationId || (ConversationId.Equals(input.ConversationId)) ) && ( EnableInvitationMessagingForAdmins == input.EnableInvitationMessagingForAdmins || (EnableInvitationMessagingForAdmins != null && EnableInvitationMessagingForAdmins.Equals(input.EnableInvitationMessagingForAdmins)) ) && ( BanExpireDate == input.BanExpireDate || (BanExpireDate != null && BanExpireDate.Equals(input.BanExpireDate)) ) && ( Features == input.Features || (Features != null && Features.Equals(input.Features)) ) && ( ClanInfo == input.ClanInfo || (ClanInfo != null && ClanInfo.Equals(input.ClanInfo)) )); }
public bool GetIsPublic() { return(IsPublic.ToBooleanFrom1()); }