Beispiel #1
0
 private void LoadInformation()
 {
     Version          = new VersionToken(Environment.OSVersion.Version);
     VersionString    = Environment.OSVersion.VersionString;
     ServicePack      = Environment.OSVersion.ServicePack;
     Name             = Environment.MachineName;
     Description      = GetDescription();
     SerialNumber     = GetSerialNumber();
     ProductId        = GetProductId();
     ProcessorId      = GetProcessorId();
     ArchitectureType = GetProcessArchitectureType();
     Hash             = GetHash(ProductId, ProcessorId, SerialNumber);
 }
Beispiel #2
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Hash             = objBinaryReader.ReadString();
            Name             = objBinaryReader.ReadString();
            Description      = objBinaryReader.ReadString();
            ProductId        = objBinaryReader.ReadString();
            ProcessorId      = objBinaryReader.ReadString();
            SerialNumber     = objBinaryReader.ReadString();
            ArchitectureType = (ComputerProcessorArchitectureType)objBinaryReader.ReadByte();
            VersionString    = objBinaryReader.ReadString();
            ServicePack      = objBinaryReader.ReadString();
            Version          = objBinaryReader.ReadTransportableObject <VersionToken>();
        }
Beispiel #3
0
        public override void ReadData(SerializedObject objSerializedObject)
        {
            base.ReadData(objSerializedObject);

            Hash             = objSerializedObject.Values.GetValue <string>("Hash", string.Empty);
            Name             = objSerializedObject.Values.GetValue <string>("Name", string.Empty);
            Description      = objSerializedObject.Values.GetValue <string>("Description", string.Empty);
            ProductId        = objSerializedObject.Values.GetValue <string>("ProductId", string.Empty);
            ProcessorId      = objSerializedObject.Values.GetValue <string>("ProcessorId", string.Empty);
            SerialNumber     = objSerializedObject.Values.GetValue <string>("SerialNumber", string.Empty);
            ArchitectureType = objSerializedObject.Values.GetValue <ComputerProcessorArchitectureType>("ArchitectureType", ComputerProcessorArchitectureType.Unknown);
            VersionString    = objSerializedObject.Values.GetValue <string>("VersionString", string.Empty);
            ServicePack      = objSerializedObject.Values.GetValue <string>("ServicePack", string.Empty);
            Version          = objSerializedObject.Objects.GetObject <VersionToken>("Version", null);
        }
Beispiel #4
0
        public override bool Equals(object objObject)
        {
            VersionToken objVersionToken1 = this;
            VersionToken objVersionToken2 = objObject as VersionToken;

            if ((objVersionToken1 == null) && (objVersionToken2 == null))
            {
                return(true);
            }
            else if (objVersionToken1 == null)
            {
                return(false);
            }
            else if (objVersionToken2 == null)
            {
                return(false);
            }

            Version objVersion1 = new Version(objVersionToken1.Major, objVersionToken1.Minor, objVersionToken1.Build, objVersionToken1.Revision);
            Version objVersion2 = new Version(objVersionToken2.Major, objVersionToken2.Minor, objVersionToken2.Build, objVersionToken2.Revision);

            return(objVersion1.Equals(objVersion2));
        }