コード例 #1
0
        public TeamViewModel(Team team, string loggedInUser = "")
        {
            Id                     = team.Id;
            TeamCode               = team.TeamCode;
            TeamName               = team.TeamName;
            Theme                  = team.Theme;
            ProblemStatement       = team.ProblemStatement;
            ITRequirements         = team.ITRequirements;
            OtherRequirements      = team.OtherRequirements;
            Participants           = SerializeParticipants(team.Participants);
            CreatedBy              = team.CreatedBy ?? "";
            CreatedOn              = team.CreatedOn;
            CreatedByFormatted     = $"{CreatedBy} [On {CreatedOn:MMM dd hh:mm tt}]";
            IsCreatedByCurrentUser = CreatedBy.Equals(loggedInUser);
            RepoUrl                = team.RepoUrl;
            Location               = team.Location;

            //Convert byte array as base64 encoded string
            if (team?.Avatar?.Length > 0)
            {
                string avatarDataUrl;
                string avatarBase64 = Convert.ToBase64String(team.Avatar);
                avatarDataUrl = $"data:image/png;base64,{avatarBase64}";
                AvatarDataUrl = avatarDataUrl;
            }
        }
コード例 #2
0
        public bool Equals(PhysicalObject other)
        {
            if (other == null)
            {
                return(false);
            }

            return(ModelIndex.Equals(other.ModelIndex) &&
                   Handle.Equals(other.Handle) &&
                   Position.Equals(other.Position) &&
                   UprootLimit.Equals(other.UprootLimit) &&
                   CreatedBy.Equals(other.CreatedBy) &&
                   IsPickup.Equals(other.IsPickup) &&
                   IsPickupInShop.Equals(other.IsPickupInShop) &&
                   IsPickupOutOfStock.Equals(other.IsPickupOutOfStock) &&
                   IsGlassCracked.Equals(other.IsGlassCracked) &&
                   IsGlassBroken.Equals(other.IsGlassBroken) &&
                   HasBeenDamaged.Equals(other.HasBeenDamaged) &&
                   UseCarColors.Equals(other.UseCarColors) &&
                   CostValue.Equals(other.CostValue) &&
                   BonusValue.Equals(other.BonusValue) &&
                   CollisionDamageMultiplier.Equals(other.CollisionDamageMultiplier) &&
                   CollisionDamageEffect.Equals(other.CollisionDamageEffect) &&
                   SpecialCollisionResponseCases.Equals(other.SpecialCollisionResponseCases) &&
                   EndOfLifeTime.Equals(other.EndOfLifeTime) &&
                   EntityType.Equals(other.EntityType) &&
                   EntityStatus.Equals(other.EntityStatus) &&
                   EntityFlags.Equals(other.EntityFlags));
        }
コード例 #3
0
        /// <summary>
        /// Returns true if AppTemplateConfiguration instances are equal
        /// </summary>
        /// <param name="other">Instance of AppTemplateConfiguration to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AppTemplateConfiguration other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     CreatedBy == other.CreatedBy ||
                     CreatedBy != null &&
                     CreatedBy.Equals(other.CreatedBy)
                 ) &&
                 (
                     CreatedAt == other.CreatedAt ||
                     CreatedAt != null &&
                     CreatedAt.Equals(other.CreatedAt)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Secret == other.Secret ||
                     Secret != null &&
                     Secret.Equals(other.Secret)
                 ) &&
                 (
                     Enabled == other.Enabled ||

                     Enabled.Equals(other.Enabled)
                 ));
        }
コード例 #4
0
        public bool Equals(OwnerHistoryKey other)
        {
            // First two lines are just optimizations
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(CreatedBy.Equals(other.CreatedBy, StringComparison.OrdinalIgnoreCase) &&
                   ExtSystem.Equals(other.ExtSystem, StringComparison.OrdinalIgnoreCase) &&
                   CreatedOn.ToString().Equals(other.CreatedOn.ToString(), StringComparison.OrdinalIgnoreCase));
        }
コード例 #5
0
        public bool Equals(GroupBan input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     GroupId == input.GroupId ||
                     (GroupId.Equals(input.GroupId))
                     ) &&
                 (
                     LastModifiedBy == input.LastModifiedBy ||
                     (LastModifiedBy != null && LastModifiedBy.Equals(input.LastModifiedBy))
                 ) &&
                 (
                     CreatedBy == input.CreatedBy ||
                     (CreatedBy != null && CreatedBy.Equals(input.CreatedBy))
                 ) &&
                 (
                     DateBanned == input.DateBanned ||
                     (DateBanned != null && DateBanned.Equals(input.DateBanned))
                 ) &&
                 (
                     DateExpires == input.DateExpires ||
                     (DateExpires != null && DateExpires.Equals(input.DateExpires))
                 ) &&
                 (
                     Comment == input.Comment ||
                     (Comment != null && Comment.Equals(input.Comment))
                 ) &&
                 (
                     BungieNetUserInfo == input.BungieNetUserInfo ||
                     (BungieNetUserInfo != null && BungieNetUserInfo.Equals(input.BungieNetUserInfo))
                 ) &&
                 (
                     DestinyUserInfo == input.DestinyUserInfo ||
                     (DestinyUserInfo != null && DestinyUserInfo.Equals(input.DestinyUserInfo))
                 ));
        }
コード例 #6
0
ファイル: PlayerPed.cs プロジェクト: whampson/gta-save-data
        public bool Equals(PlayerPed other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Type.Equals(other.Type) &&
                   ModelIndex.Equals(other.ModelIndex) &&
                   Handle.Equals(other.Handle) &&
                   Position.Equals(other.Position) &&
                   CreatedBy.Equals(other.CreatedBy) &&
                   Health.Equals(other.Health) &&
                   Armor.Equals(other.Armor) &&
                   Weapons.SequenceEqual(other.Weapons) &&
                   MaxStamina.Equals(other.MaxStamina) &&
                   TargetableObjects.SequenceEqual(other.TargetableObjects) &&
                   MaxWantedLevel.Equals(other.MaxWantedLevel) &&
                   MaxChaosLevel.Equals(other.MaxChaosLevel) &&
                   ModelName.Equals(other.ModelName));
        }
コード例 #7
0
ファイル: Vehicle.cs プロジェクト: whampson/gta-save-data
        public bool Equals(Vehicle other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Type.Equals(other.Type) &&
                   ModelIndex.Equals(other.ModelIndex) &&
                   Handle.Equals(other.Handle) &&
                   Matrix.Equals(other.Matrix) &&
                   EntityType.Equals(other.EntityType) &&
                   EntityStatus.Equals(other.EntityStatus) &&
                   EntityFlags.Equals(other.EntityFlags) &&
                   AutoPilot.Equals(other.AutoPilot) &&
                   Color1.Equals(other.Color1) &&
                   Color2.Equals(other.Color2) &&
                   AlarmState.Equals(other.AlarmState) &&
                   MaxNumPassengers.Equals(other.MaxNumPassengers) &&
                   Field1D0h.Equals(other.Field1D0h) &&
                   Field1D4h.Equals(other.Field1D4h) &&
                   Field1D8h.Equals(other.Field1D8h) &&
                   Field1DCh.Equals(other.Field1DCh) &&
                   SteerAngle.Equals(other.SteerAngle) &&
                   GasPedal.Equals(other.GasPedal) &&
                   BrakePedal.Equals(other.BrakePedal) &&
                   CreatedBy.Equals(other.CreatedBy) &&
                   IsLawEnforcer.Equals(other.IsLawEnforcer) &&
                   IsLockedByScript.Equals(other.IsLockedByScript) &&
                   IsEngineOn.Equals(other.IsEngineOn) &&
                   IsHandbrakeOn.Equals(other.IsHandbrakeOn) &&
                   LightsOn.Equals(other.LightsOn) &&
                   HasFreebies.Equals(other.HasFreebies) &&
                   Health.Equals(other.Health) &&
                   CurrentGear.Equals(other.CurrentGear) &&
                   ChangeGearTime.Equals(other.ChangeGearTime) &&
                   TimeOfDeath.Equals(other.TimeOfDeath) &&
                   BombTimer.Equals(other.BombTimer) &&
                   DoorLock.Equals(other.DoorLock));
        }
コード例 #8
0
 public bool IsEditable(string userName)
 {
     return(CreatedBy.Equals(userName));
 }
コード例 #9
0
 public bool IsAnonymous()
 {
     return(CreatedBy.Equals(Guid.Empty.ToString()));
 }