Exemplo n.º 1
0
        private static TTransportableObjectType Expand <TTransportableObjectType>(Stream objStream)
            where TTransportableObjectType : TransportableObject
        {
            if (objStream == null)
            {
                throw new ArgumentNullException("objStream", "A valid non-null Stream is required.");
            }

            TTransportableObjectType objTransportableObject = default(TTransportableObjectType);

            using (BinaryReaderExtension objBinaryReader = new BinaryReaderExtension(objStream))
            {
                byte[] bytSignature = objBinaryReader.ReadBytes(RemotableSignature.Length);
                if (AreByteArraysEqual(bytSignature, RemotableSignature) == false)
                {
                    throw new Exception("The binary data does not represent a valid, serialized ITransportableObject instance.");
                }

                string strAssemblyName = objBinaryReader.ReadString();
                string strTypeName     = objBinaryReader.ReadString();

                objTransportableObject = FastReflectionManager.CreateInstance <TTransportableObjectType>(typeof(TTransportableObjectType), new Type[] { typeof(BinaryReaderExtension) }, objBinaryReader);
            }

            return(objTransportableObject);
        }
Exemplo n.º 2
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Source = objBinaryReader.ReadString();
            Log    = objBinaryReader.ReadString();
        }
Exemplo n.º 3
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Message  = objBinaryReader.ReadString();
            Category = objBinaryReader.ReadString();
        }
Exemplo n.º 4
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Port        = objBinaryReader.ReadInt32();
            ChannelName = objBinaryReader.ReadString();
            MachineName = objBinaryReader.ReadString();
        }
Exemplo n.º 5
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            CreatedDate = objBinaryReader.ReadDateTime();
            MachineName = objBinaryReader.ReadString();
            WindowsId   = objBinaryReader.ReadString();
        }
Exemplo n.º 6
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Name     = objBinaryReader.ReadString();
            FullName = objBinaryReader.ReadString();
            Enabled  = objBinaryReader.ReadBoolean();
        }
Exemplo n.º 7
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            SqlStatement     = objBinaryReader.ReadString();
            SqlParameters    = objBinaryReader.ReadString();
            ConnectionString = objBinaryReader.ReadEncryptedString();
        }
Exemplo n.º 8
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Path         = objBinaryReader.ReadString();
            DisplayName  = objBinaryReader.ReadString();
            Size         = objBinaryReader.ReadInt64();
            ModifiedDate = objBinaryReader.ReadDateTime();
        }
Exemplo n.º 9
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Source      = objBinaryReader.ReadString();
            Destination = objBinaryReader.ReadString();
            Credentials = objBinaryReader.ReadTransportableObject <Credentials>();
            TimeOut     = objBinaryReader.ReadInt32();
        }
Exemplo n.º 10
0
        private static ITransportableObject Expand(Stream objStream)
        {
            if (objStream == null)
            {
                throw new ArgumentNullException("objStream", "A valid non-null Stream is required.");
            }

            ITransportableObject objTransportableObject = null;

            using (BinaryReaderExtension objBinaryReader = new BinaryReaderExtension(objStream))
            {
                byte[] bytSignature = objBinaryReader.ReadBytes(RemotableSignature.Length);
                if (AreByteArraysEqual(bytSignature, RemotableSignature) == false)
                {
                    throw new Exception("The binary data does not represent a valid, serialized ITransportableObject instance.");
                }

                string strAssemblyName = objBinaryReader.ReadString();
                string strTypeName     = objBinaryReader.ReadString();

                Assembly objAssembly = null;
                try
                {
                    objAssembly = Assembly.Load(strAssemblyName);
                }
                catch (Exception objException)
                {
                    string strErrorMessage = "An error was encountered while loading the assembly - Assembly.Load('" + strAssemblyName + "'):\n";
                    throw new Exception(strErrorMessage, objException);
                }

                Type objType = null;
                try
                {
                    objType = objAssembly.GetType(strTypeName, true, true);
                }
                catch (Exception objException)
                {
                    string strErrorMessage = "An error was encountered while loading the type - objAssemblyName.GetType('" + strTypeName + "', True, True):\n";
                    throw new Exception(strErrorMessage, objException);
                }

                try
                {
                    objTransportableObject = FastReflectionManager.CreateInstance <ITransportableObject>(objType, new Type[] { typeof(BinaryReaderExtension) }, objBinaryReader);
                }
                catch (Exception objException)
                {
                    string strErrorMessage = "An error was encountered while creating the object - Activator.CreateInstance('" + objType.FullName + "'):\n";
                    throw new Exception(strErrorMessage, objException);
                }
            }

            return(objTransportableObject);
        }
Exemplo n.º 11
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            From       = objBinaryReader.ReadString();
            Subject    = objBinaryReader.ReadString();
            IsBodyHtml = objBinaryReader.ReadBoolean();
            Body       = objBinaryReader.ReadString();
            DeliveryNotificationOptions = (NetMail.DeliveryNotificationOptions)objBinaryReader.ReadByte();
            To = objBinaryReader.ReadTransportableObject <ListBase <string> >();
        }
Exemplo n.º 12
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            string strType = objBinaryReader.ReadString();

            Type = System.Type.GetType(strType);

            Binding = objBinaryReader.ReadTransportableObject <IWcfBinding>();
            Address = objBinaryReader.ReadString();
        }
Exemplo n.º 13
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            FileName  = objBinaryReader.ReadString();
            Directory = objBinaryReader.ReadString();

            _objSyncObject = null;
            _objFileStream = null;
            _objTextWriter = null;
        }
Exemplo n.º 14
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Guid     = objBinaryReader.ReadGuid();
            UserName = objBinaryReader.ReadString();
        }
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Url         = objBinaryReader.ReadString();
            Credentials = objBinaryReader.ReadTransportableObject <Credentials>();
        }
Exemplo n.º 16
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Details   = objBinaryReader.ReadString();
            Exception = (Exception)objBinaryReader.ReadObject();
        }
Exemplo n.º 17
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            _strName   = objBinaryReader.ReadString();
            _enuStatus = (JobStatusType)objBinaryReader.ReadByte();
            _objTasks  = objBinaryReader.ReadTransportableObject <ITaskList>();
        }
Exemplo n.º 18
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            ApplicationManager.Logs     = objBinaryReader.ReadTransportableObject <LogManager>();
            ApplicationManager.Settings = objBinaryReader.ReadTransportableObject <SettingsManager>();
            ApplicationManager.FilePath = objBinaryReader.ReadString();
        }
Exemplo n.º 19
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            PerformanceCounters = objBinaryReader.ReadString();
            ConcurrencyMode     = objBinaryReader.ReadEnum <ConcurrencyMode>();
            InstanceContextMode = objBinaryReader.ReadEnum <InstanceContextMode>();
        }
Exemplo n.º 20
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            UploadRequest = objBinaryReader.ReadTransportableObject <UploadRequest>();
            Result        = (TaskResultType)objBinaryReader.ReadByte();
            UploadStats   = objBinaryReader.ReadTransportableObject <UploadStats>();
            Details       = objBinaryReader.ReadString();
        }
Exemplo n.º 21
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Enabled               = objBinaryReader.ReadBoolean();
            Address               = objBinaryReader.ReadString();
            Port                  = objBinaryReader.ReadInt32();
            Credentials           = objBinaryReader.ReadTransportableObject <Credentials>();
            BypassProxyOnLocal    = objBinaryReader.ReadBoolean();
            UseDefaultCredentials = objBinaryReader.ReadBoolean();
        }
Exemplo n.º 22
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Host                  = objBinaryReader.ReadString();
            Port                  = objBinaryReader.ReadInt32();
            EnableSsl             = objBinaryReader.ReadBoolean();
            TimeOut               = objBinaryReader.ReadInt32();
            DeliveryMethod        = (NetMail.SmtpDeliveryMethod)objBinaryReader.ReadByte();
            UseDefaultCredentials = objBinaryReader.ReadBoolean();
            Credentials           = objBinaryReader.ReadTransportableObject <Credentials>();
        }
Exemplo n.º 23
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>();
        }
Exemplo n.º 24
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            int intCount = objBinaryReader.ReadInt32();

            for (int intIndex = 0; intIndex < intCount; intIndex++)
            {
                string strKey   = objBinaryReader.ReadString();
                object objValue = objBinaryReader.ReadObject();

                Settings.Add(strKey, objValue);
            }
        }
Exemplo n.º 25
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Behavior   = objBinaryReader.ReadTransportableObject <WcfServiceBehavior>();
            Throttling = objBinaryReader.ReadTransportableObject <WcfServiceThrottling>();

            string strType = objBinaryReader.ReadString();

            Type = System.Type.GetType(strType);

            BaseAddresses    = objBinaryReader.ReadTransportableObject <ListBase <string> >();
            ServiceEndpoints = objBinaryReader.ReadTransportableObject <WcfServiceEndpointList>();
            MetadataEndpoint = objBinaryReader.ReadTransportableObject <WcfMetadataEndpoint>();
        }
Exemplo n.º 26
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Address = objBinaryReader.ReadString();
        }