コード例 #1
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Source = objBinaryReader.ReadString();
            Log    = objBinaryReader.ReadString();
        }
コード例 #2
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Enabled      = objBinaryReader.ReadBoolean();
            MessageTypes = objBinaryReader.ReadTransportableObject <MessageTypeCollection>();
        }
コード例 #3
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);
        }
コード例 #4
0
ファイル: EmailLog.cs プロジェクト: wuhaiying83/EMR
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            SmtpClient        = objBinaryReader.ReadTransportableObject <SmtpClient>();
            DefaulMailMessage = objBinaryReader.ReadTransportableObject <MailMessage>();
        }
コード例 #5
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Details   = objBinaryReader.ReadString();
            Exception = (Exception)objBinaryReader.ReadObject();
        }
コード例 #6
0
 public ObjectBase(BinaryReaderExtension objBinaryReader)
     : this()
 {
     BeginInit();
     ReadData(objBinaryReader);
     EndInit();
 }
コード例 #7
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Url         = objBinaryReader.ReadString();
            Credentials = objBinaryReader.ReadTransportableObject <Credentials>();
        }
コード例 #8
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Message  = objBinaryReader.ReadString();
            Category = objBinaryReader.ReadString();
        }
コード例 #9
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Binding         = objBinaryReader.ReadTransportableObject <IWcfBinding>();
            EndpointAddress = objBinaryReader.ReadTransportableObject <WcfEndpointAddress>();
            Priority        = objBinaryReader.ReadInt32();
        }
コード例 #10
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Port        = objBinaryReader.ReadInt32();
            ChannelName = objBinaryReader.ReadString();
            MachineName = objBinaryReader.ReadString();
        }
コード例 #11
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Enabled           = objBinaryReader.ReadBoolean();
            InactivityTimeout = objBinaryReader.ReadTimeSpan();
            Ordered           = objBinaryReader.ReadBoolean();
        }
コード例 #12
0
ファイル: WcfServiceBehavior.cs プロジェクト: wuhaiying83/EMR
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            PerformanceCounters = objBinaryReader.ReadString();
            ConcurrencyMode     = objBinaryReader.ReadEnum <ConcurrencyMode>();
            InstanceContextMode = objBinaryReader.ReadEnum <InstanceContextMode>();
        }
コード例 #13
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            MaxConcurrentCalls     = objBinaryReader.ReadInt32();
            MaxConcurrentInstances = objBinaryReader.ReadInt32();
            MaxConcurrentSessions  = objBinaryReader.ReadInt32();
        }
コード例 #14
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Path         = objBinaryReader.ReadString();
            DisplayName  = objBinaryReader.ReadString();
            Size         = objBinaryReader.ReadInt64();
            ModifiedDate = objBinaryReader.ReadDateTime();
        }
コード例 #15
0
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Source      = objBinaryReader.ReadString();
            Destination = objBinaryReader.ReadString();
            Credentials = objBinaryReader.ReadTransportableObject <Credentials>();
            TimeOut     = objBinaryReader.ReadInt32();
        }
コード例 #16
0
ファイル: JobResult.cs プロジェクト: wuhaiying83/EMR
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            Job         = objBinaryReader.ReadTransportableObject <Job>();
            StartTime   = objBinaryReader.ReadDateTime();
            EndTime     = objBinaryReader.ReadDateTime();
            Result      = (JobResultType)objBinaryReader.ReadByte();
            TaskResults = objBinaryReader.ReadTransportableObject <TaskResultList>();
        }
コード例 #17
0
ファイル: WcfReaderQuotas.cs プロジェクト: wuhaiying83/EMR
        public override void ReadData(BinaryReaderExtension objBinaryReader)
        {
            base.ReadData(objBinaryReader);

            MaxArrayLength         = objBinaryReader.ReadInt32();
            MaxBytesPerRead        = objBinaryReader.ReadInt32();
            MaxDepth               = objBinaryReader.ReadInt32();
            MaxNameTableCharCount  = objBinaryReader.ReadInt32();
            MaxStringContentLength = objBinaryReader.ReadInt32();
        }
コード例 #18
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);
        }
コード例 #19
0
ファイル: ShpReader.cs プロジェクト: hakbra/SGIS
        public Layer readImpl(string filename)
        {
            // split filename in path and filename
            string[] split = filename.Split('\\');
            string name = split.Last();
            // remove extension
            name = name.Substring(0, name.Length - 4);
            string path = filename.Substring(0, filename.Length - name.Length - 4);

            layer = new Layer(name);

            // read .prj-file with same name or with name 'default.prj'
            string prjName = filename.Substring(0, filename.Length - 3) + "prj";
            if (File.Exists(prjName))
                layer.Projection = PrjReader.read(prjName);
            else if (File.Exists(path + "default.prj"))
                layer.Projection = PrjReader.read(path + "default.prj");
            else
            {
                // warning message if missing prj file
                string msg = "No projection da found. Assuming " + SGIS.App.getSrsName();
                MessageBox.Show(msg, "Missing spatial reference system: " + name, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            // try reading attribute file with same name
            string dbfName = filename.Substring(0, filename.Length - 3) + "dbf";
            if (File.Exists(dbfName))
                layer.DataTable = DbfReader.read(dbfName);

            // create stream from file
            FileStream f = File.Open(filename, FileMode.Open);
            br = new BinaryReaderExtension(f);
            pos = 0;
            length = (int)br.BaseStream.Length;

            readHeader();

            // set bounding box from values in header
            layer.Boundingbox = new Envelope(minx, maxx, miny, maxy);
            layer.createQuadTree();

            // content starts at pos 100
            pos = 100;

            // read all shapes until end
            while (pos < length)
                readShape();

            br.Close();

            // features now converted to application srs
            layer.Projection = SGIS.App.SRS;
            return layer;
        }