Exemplo n.º 1
0
 public ProcessImage(List <ImageProperty> imageProperties, BitmapImage img, RaidLevel raidLevel, GymColor color)
 {
     _imageProperties = imageProperties;
     _screenshot      = img;
     _raidLevel       = raidLevel;
     _gymColor        = color;
 }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (pokemon_ != null)
            {
                hash ^= Pokemon.GetHashCode();
            }
            if (EncounterId != 0L)
            {
                hash ^= EncounterId.GetHashCode();
            }
            if (SpawnpointId.Length != 0)
            {
                hash ^= SpawnpointId.GetHashCode();
            }
            if (captureProbabilities_ != null)
            {
                hash ^= CaptureProbabilities.GetHashCode();
            }
            if (ThrowsRemaining != 0)
            {
                hash ^= ThrowsRemaining.GetHashCode();
            }
            if (RaidLevel != 0)
            {
                hash ^= RaidLevel.GetHashCode();
            }
            if (FortId.Length != 0)
            {
                hash ^= FortId.GetHashCode();
            }
            return(hash);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (RaidSeed != 0L)
            {
                hash ^= RaidSeed.GetHashCode();
            }
            if (RaidSpawnMs != 0L)
            {
                hash ^= RaidSpawnMs.GetHashCode();
            }
            if (RaidBattleMs != 0L)
            {
                hash ^= RaidBattleMs.GetHashCode();
            }
            if (RaidEndMs != 0L)
            {
                hash ^= RaidEndMs.GetHashCode();
            }
            if (raidPokemon_ != null)
            {
                hash ^= RaidPokemon.GetHashCode();
            }
            if (RaidLevel != 0)
            {
                hash ^= RaidLevel.GetHashCode();
            }
            if (Complete != false)
            {
                hash ^= Complete.GetHashCode();
            }
            if (IsExclusive != false)
            {
                hash ^= IsExclusive.GetHashCode();
            }
            if (IsRaidHidden != false)
            {
                hash ^= IsRaidHidden.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        public void Create(int raidSetId, double sizeInGb, RaidLevel level, int?ch, int?id, int?lun, string name, Decide?tag, Decide?cache, StripeSize?stripe, Decide?fginit, GreaterThan2TbVolumeSupport?gt2tb)
        {
            var command = new StringBuilder("vsf create ");

            command.Append("raid=");
            command.Append(raidSetId.ToString());
            command.Append(" capacity=");
            command.Append(sizeInGb.ToString());
            command.Append(" level=");
            command.Append(((byte)level).ToString());

            AppendIntValue(command, "ch", ch);
            AppendIntValue(command, "id", id);
            AppendIntValue(command, "lun", lun);
            if (name != null)
            {
                command.Append(" name=");
                command.Append(name);
            }
            if (tag != null)
            {
                command.Append(" tag=");
                command.Append(tag == Decide.No ? 'N' : 'Y');
            }
            if (cache != null)
            {
                command.Append(" cache=");
                command.Append(cache == Decide.No ? 'N' : 'Y');
            }
            if (stripe != null)
            {
                command.Append(" stripe=");
                command.Append(((byte)stripe).ToString());
            }
            if (fginit != null)
            {
                command.Append(" fginit=");
                command.Append(fginit == Decide.No ? 'N' : 'Y');
            }
            if (gt2tb != null)
            {
                command.Append(" gt2tb=");
                command.Append(gt2tb == GreaterThan2TbVolumeSupport._4_KByte_for_Windows ? "64BIT" : "WIN");
            }
            ExcecuteCommand(command.ToString());
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (RaidTelemetryId != 0)
            {
                hash ^= RaidTelemetryId.GetHashCode();
            }
            if (BundleVersion.Length != 0)
            {
                hash ^= BundleVersion.GetHashCode();
            }
            if (TimeSinceEnterRaid != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TimeSinceEnterRaid);
            }
            if (TimeSinceLastRaidTelemetry != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TimeSinceLastRaidTelemetry);
            }
            if (RaidLevel != 0)
            {
                hash ^= RaidLevel.GetHashCode();
            }
            if (PrivateLobby != false)
            {
                hash ^= PrivateLobby.GetHashCode();
            }
            if (TicketItem.Length != 0)
            {
                hash ^= TicketItem.GetHashCode();
            }
            if (NumPlayersInLobby != 0)
            {
                hash ^= NumPlayersInLobby.GetHashCode();
            }
            if (BattlePartyNumber != 0)
            {
                hash ^= BattlePartyNumber.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 6
0
        public static byte ToMarvellRaidLevel(RaidLevel level)
        {
            switch (level)
            {
            case RaidLevel.RAID_0:
                return(0);

            case RaidLevel.RAID_1:
                return(1);

            case RaidLevel.RAID_5:
                return(5);

            case RaidLevel.RAID_6:
                return(6);

            case RaidLevel.RAID_10:
                return(16);

            default:
                return(byte.MaxValue);
            }
        }
Exemplo n.º 7
0
        public override StorApiStatus Migrate(RaidLevel newLevel, List <Drive> newDrives)
        {
            StorApiStatus storApiStatus = StorApiStatusEnum.STOR_NO_ERROR;
            byte          b             = 0;

            MvApi.MvApi.Create_LD_Param   create_LD_Param   = default(MvApi.MvApi.Create_LD_Param);
            MvApi.MvApi.LD_Config_Request ld_Config_Request = default(MvApi.MvApi.LD_Config_Request);
            int num = 0;

            ld_Config_Request.header.Init();
            ld_Config_Request.header.requestType       = 2;
            ld_Config_Request.header.startingIndexOrId = this.mvid;
            ld_Config_Request.header.numRequested      = 1;
            lock (MarvellUtil.mvApiLock)
            {
                try
                {
                    b = MvApi.MvApi.MV_LD_GetConfig(((MarvellController)this.controller).AdapterId, ref ld_Config_Request);
                }
                catch (Exception ex)
                {
                    Logger.Warn("MV_LD_GetConfig exception: {0}", new object[]
                    {
                        ex
                    });
                    return(StorApiStatusEnum.STOR_API_ERROR);
                }
                if (b != 0)
                {
                    storApiStatus = MarvellUtil.ToStorApiStatus(b);
                    storApiStatus.internalIntData = (int)b;
                    Logger.Warn("MV_LD_GetConfig failed: {0}", new object[]
                    {
                        b
                    });
                    return(storApiStatus);
                }
                string @string = Encoding.ASCII.GetString(ld_Config_Request.ldConfig[0].Name);
                create_LD_Param.LDID                 = this.MvId;
                create_LD_Param.RaidMode             = MarvellUtil.ToMarvellRaidLevel(newLevel);
                create_LD_Param.RoundingScheme       = 0;
                create_LD_Param.InitializationOption = 0;
                create_LD_Param.HDIDs                = new short[128];
                foreach (Drive drive in this.drives)
                {
                    if (num >= 128)
                    {
                        storApiStatus = StorApiStatusEnum.STOR_INVALID_PARAM;
                        return(storApiStatus);
                    }
                    create_LD_Param.HDIDs[num] = ((MarvellDrive)drive).MvId;
                    num++;
                }
                foreach (Drive drive2 in newDrives)
                {
                    if (num >= 128)
                    {
                        storApiStatus = StorApiStatusEnum.STOR_INVALID_PARAM;
                        return(storApiStatus);
                    }
                    create_LD_Param.HDIDs[num] = ((MarvellDrive)drive2).MvId;
                    num++;
                }
                create_LD_Param.HDCount = (byte)num;
                create_LD_Param.Name    = new byte[16];
                ld_Config_Request.ldConfig[0].Name.CopyTo(create_LD_Param.Name, 0);
                Logger.Debug("Migrate parameter: LD={0}, RAID={1}, HDCount={2}, HD={3}, Name={4}", new object[]
                {
                    create_LD_Param.LDID,
                    create_LD_Param.RaidMode,
                    create_LD_Param.HDCount,
                    string.Join <short>(" ", create_LD_Param.HDIDs.ToList <short>().GetRange(0, (int)create_LD_Param.HDCount)),
                    @string
                });
                try
                {
                    b = MvApi.MvApi.MV_LD_StartMigration(((MarvellController)this.controller).AdapterId, ref create_LD_Param);
                }
                catch (Exception ex2)
                {
                    Logger.Warn("MV_LD_StartMigration exception: {0}", new object[]
                    {
                        ex2
                    });
                    return(StorApiStatusEnum.STOR_API_ERROR);
                }
                if (b != 0)
                {
                    storApiStatus = MarvellUtil.ToStorApiStatus(b);
                    storApiStatus.internalIntData = (int)b;
                    Logger.Warn("MV_LD_StartMigration failed: {0}", new object[]
                    {
                        b
                    });
                }
            }
            return(storApiStatus);
        }
Exemplo n.º 8
0
 public virtual StorApiStatus Migrate(RaidLevel newLevel, List <Drive> newDrives)
 {
     return(StorApiStatusEnum.STOR_NOT_IMPLEMENTED);
 }
Exemplo n.º 9
0
 private void RaidLevelsBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     _raidLevel = (RaidLevel)Enum.Parse(typeof(RaidLevel), raidLevelsBox.SelectedValue.ToString());
 }