Example #1
0
        public async Task <int> Get(string name)
        {
            int version = -1;

            try
            {
                var query  = TVersion.Where(A => A.Name == name);
                var result = await query.ToListAsync();

                if (result.Count > 0)
                {
                    version = result[0].Number;
                }
            }
            catch (SQLiteException ex)
            {
                // No such table wird ignoriert da die Versionstabelle ebenfalls ihre
                // Version in sich selbst speichert. Beim ersten Start also durchaus vertretbar.
                if (ex.HResult != -2146233088)
                {
                    throw ex;
                }
            }

            return(version);
        }
        internal SIHeaderE32Image(SIImage aImage, SymbianStreamReaderLE aReader)
            : base(aImage)
        {
            long startPos = aReader.Position;

            //
            iUids      = new TCheckedUid(aReader);
            iSignature = aReader.ReadUInt32();
            //
            if (iSignature != KExpectedSignatureUInt32)   // 'EPOC'
            {
                throw new E32ImageNotSupportedException("Invalid signature");
            }
            //
            iHeaderCrc       = aReader.ReadUInt32();
            iModuleVersion   = aReader.ReadUInt32();
            iCompressionType = SIHeaderE32Image.ReadCompressionType(aReader);
            iToolsVersion    = new TVersion(aReader);
            iTimeLo          = aReader.ReadUInt32();
            iTimeHi          = aReader.ReadUInt32();
            iFlags           = aReader.ReadUInt32();
            //
            iCodeSize    = aReader.ReadInt32();
            iDataSize    = aReader.ReadInt32();
            iHeapSizeMin = aReader.ReadInt32();
            iHeapSizeMax = aReader.ReadInt32();
            iStackSize   = aReader.ReadInt32();
            iBssSize     = aReader.ReadInt32();
            //
            iEntryPoint = aReader.ReadUInt32();
            iCodeBase   = aReader.ReadUInt32();
            iDataBase   = aReader.ReadUInt32();
            //
            iDllRefTableCount = aReader.ReadInt32();
            iExportDirOffset  = aReader.ReadUInt32();
            iExportDirCount   = aReader.ReadInt32();
            //
            iTextSize        = aReader.ReadInt32();
            iCodeOffset      = aReader.ReadUInt32();
            iDataOffset      = aReader.ReadUInt32();
            iImportOffset    = aReader.ReadUInt32();
            iCodeRelocOffset = aReader.ReadUInt32();
            iDataRelocOffset = aReader.ReadUInt32();
            //
            iProcessPriority = aReader.ReadInt16();
            //
            iCpuIdentifier = aReader.ReadUInt16();
            //
            iUncompressedSize = aReader.ReadUInt32();
            //
            iS = new SSecurityInfo(aReader);
            iExceptionDescriptor = aReader.ReadUInt32();
            iSpare2         = aReader.ReadUInt16();
            iExportDescSize = aReader.ReadUInt16();
            iExportDescType = aReader.ReadUInt8();
            //
            iHeaderSize = (uint)(aReader.Position - startPos);
        }
        private static TVersion GetVersionObject(string file)
        {
            string[] tokens = file.Split('.');
            TVersion ver    = new TVersion(file);

            for (int k = 0; k < tokens.Length; k++)
            {
                if (k == 0)
                {
                    ver.major = GetNumber(tokens[k]);
                }
                if (k == 1)
                {
                    ver.minor = GetNumber(tokens[k]);
                }
                if (k == 2)
                {
                    ver.relase = GetNumber(tokens[k]);
                }
            }
            return(ver);
        }
Example #4
0
 public static extern short API_GetVersion(short type, out TVersion pVersion, short boardNum);