Cannot implicitly convert type 'int' to 'System.Collections.Generic.List'

private List performWrite(MifareClassic mfc)
{
if (getText(mWriteBlockContent) == null)
{
return null;
}

        if (!mfc.IsConnected)
        {
            mfc.Connect();
        }

        List<int> ret = new List<int>();
        string content = getText(mWriteBlockContent);
        if (mWriteAll)
        {
            for (int i = 1; i < mfc.BlockCount; i++)
            {
                if ((i + 1) % 4 == 0)
                {
                    continue;
                }

                bool auth = mfc.AuthenticateSectorWithKeyA(mfc.BlockToSector(i),MifareClassic.KeyDefault);
                if (auth)
                {
                    writeBlock(mfc, i, convertString2Bytes(content));
                }
                else
                {
                    //ret.add(i);
                }
            }
        }
        else
        {
            int blockIndex;
            if (mWriteToBlock && getText(mWriteBlockIndex) != null)
            {
                blockIndex = int.Parse(getText(mWriteBlockIndex));// Integer.parseInt(getText(mWriteBlockIndex));
                if (!validateBlockIndex(mfc, blockIndex))
                {
                    //debug(getString(R.string.err_block_index_out_of_bound), true);
                    return null;
                }
                if (blockIndex == 0 || (blockIndex + 1) % 4 == 0)
                {
                    // AlertDialog.Builder(GetString(Resource.String.err_write_to_forbidden_block), true);

                    return null;
                }
            }
            else
            {
                blockIndex = randomBlockIndex(mfc);
            }
            // debug(String.format(getString(R.string.write_random_dynamic), blockIndex), false);
            bool auth = mfc.AuthenticateSectorWithKeyA(mfc.BlockToSector(blockIndex), MifareClassic.KeyDefault);
            if (auth)
            {
                writeBlock(mfc, blockIndex, convertString2Bytes(content));
            }
            else
            {
                //ret.add(blockIndex);
                //debug(getString(Resource.string.auth_failed), true);
            }
        }
        return ret;
    }
Sign In or Register to comment.