Esempio n. 1
0
File: FONT.cs Progetto: zyouhua/nvwa
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mFamilyName, "familyName");
     nSerialize._serialize(ref mRGB, "rgb");
     nSerialize._serialize(ref mSize, "size");
     nSerialize._serialize(ref mBold, "bold");
 }
Esempio n. 2
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mText, @"label");
     nSerialize._serialize(ref mIcon, @"icon");
     nSerialize._serialize(ref mCmdStr, @"command");
     nSerialize._serialize(ref mContextMenuItems, @"contextMenuItems");
 }
Esempio n. 3
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mX, @"x");
     nSerialize._serialize(ref mY, @"y");
     nSerialize._serialize(ref mW, @"w");
     base._serialize(nSerialize);
 }
Esempio n. 4
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mSize, @"size");
     nSerialize._serialize(ref mName, @"text");
     nSerialize._serialize(ref mPoint, @"point");
     base._serialize(nSerialize);
 }
 public AbsoluteOrderingRavenPersistenceEngine(IDocumentStore store, ISerialize serializer, bool consistentQueries)
     : base(store, serializer, consistentQueries)
 {
     _store = store;
     _serializer = serializer;
     _hiLoGen = new HiLoKeyGenerator(store, "", 1000);            
 }
Esempio n. 6
0
 public static Snapshot GetSnapshot(this IDataRecord record, ISerialize serializer)
 {
     return(new Snapshot(
                record[StreamIdIndex].ToGuid(),
                record[StreamRevisionIndex].ToInt(),
                serializer.Deserialize <object>(record, PayloadIndex)));
 }
Esempio n. 7
0
 public FilesHandler(ISerialize serializer, string savePath)
 {
     currentFileID   = 0;
     this.savePath   = savePath;
     filesInfo       = new List <FileInfo>();
     this.serializer = serializer;
 }
Esempio n. 8
0
 public GetEventStorePersistenceEngine(Func <IEventStoreConnection> buildConnection, Action dropAction,
                                       ISerialize serializer)
 {
     _buildConnection = buildConnection;
     _dropAction      = dropAction;
     _serializer      = serializer;
 }
Esempio n. 9
0
 public void RegisterSerialize(byte serializeType, ISerialize serializeObj)
 {
     if (!Dict.ContainsKey(serializeType))
     {
         Dict.Add(serializeType, serializeObj);
     }
 }
 private SqlPersistenceFactory(ISerialize serializer, TransactionScopeOption scopeOption,  IStreamIdHasher streamIdHasher, int pageSize)
 {
     _serializer = serializer;
     _scopeOption = scopeOption;
     _streamIdHasher = streamIdHasher ?? new Sha1StreamIdHasher();
     PageSize = pageSize;
 }
Esempio n. 11
0
        public SqlPersistenceEngine(
            IConnectionFactory connectionFactory,
            ISqlDialect dialect,
            ISerialize serializer,
            TransactionScopeOption scopeOption,
            int pageSize)
        {
            if (connectionFactory == null)
            {
                throw new ArgumentNullException("connectionFactory");
            }

            if (dialect == null)
            {
                throw new ArgumentNullException("dialect");
            }

            if (serializer == null)
            {
                throw new ArgumentNullException("serializer");
            }

            if (pageSize < 0)
            {
                throw new ArgumentException("pageSize");
            }

            this.connectionFactory = connectionFactory;
            this.dialect           = dialect;
            this.serializer        = serializer;
            this.scopeOption       = scopeOption;
            this.pageSize          = pageSize;

            Logger.Debug(Messages.UsingScope, this.scopeOption.ToString());
        }
Esempio n. 12
0
        /// <summary>
        /// Create a new engine.
        /// </summary>
        /// <param name="connectionString">The Azure blob storage connection string.</param>
        /// <param name="serializer">The serializer to use.</param>
        /// <param name="options">Options for the Azure blob storage.</param>
        public AzureBlobPersistenceEngine(string connectionString, ISerialize serializer, AzureBlobPersistenceOptions options = null)
        {
            if (String.IsNullOrEmpty(connectionString))
            {
                throw new ArgumentException("connectionString cannot be null or empty");
            }
            if (serializer == null)
            {
                throw new ArgumentNullException("serializer");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            _serializer = serializer;
            _options    = options;

            _connectionString = connectionString;
            var storageAccount = CloudStorageAccount.Parse(connectionString);

            _blobClient            = storageAccount.CreateCloudBlobClient();
            _checkpointTableClient = storageAccount.CreateCloudTableClient();
            _primaryContainer      = _blobClient.GetContainerReference(GetContainerName());
        }
Esempio n. 13
0
        private void button1_Click(object sender, EventArgs e)
        {
            _serialize = new ProtoClass();
            UwantAgvDevice _device = new UwantAgvDevice(port, _serialize);

            _device.SetMonitor();
        }
Esempio n. 14
0
        public SqlPersistenceEngine(
            IConnectionFactory connectionFactory,
            ISqlDialect dialect,
            ISerialize serializer,
            TransactionScopeOption scopeOption)
        {
            if (connectionFactory == null)
            {
                throw new ArgumentNullException("connectionFactory");
            }

            if (dialect == null)
            {
                throw new ArgumentNullException("dialect");
            }

            if (serializer == null)
            {
                throw new ArgumentNullException("serializer");
            }

            this.connectionFactory = connectionFactory;
            this.dialect           = dialect;
            this.serializer        = serializer;
            this.scopeOption       = scopeOption;
        }
Esempio n. 15
0
 public CallServiceImpl(IServiceProxyFactory serviceProxyFactory, ISerialize serialize, IEventBus eventBus, IStateManager stateManager, Oxygen.Common.Interface.ILogger logger)
 {
     this.serviceProxyFactory = serviceProxyFactory;
     this.eventBus            = eventBus;
     this.stateManager        = stateManager;
     this.serialize           = serialize;
 }
Esempio n. 16
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mNodeName, @"nodeName");
     nSerialize._serialize(ref mNodeImage, @"nodeImage");
     nSerialize._serialize(ref mNewFileNodes, @"newFileNodes");
     nSerialize._serialize(ref mNewFileNodeCommands, @"newFileNodeCommands");
 }
Esempio n. 17
0
        public static void SendData(string ip, Command cmd, object obj, Stream stream)
        {
            DataToSend dataToSend = new DataToSend(ip, cmd, obj);

            byte[] byteToSend = ISerialize.Serialize(dataToSend);
            stream.Write(byteToSend, 0, byteToSend.Length);
        }
 public SimpleEventStore(IStoreSettings<IDbConnection> settings, IServiceBus serviceBus, ISerialize serializer, ISnapshotStore snapshotStore)
 {
     _settings = settings;
     _serviceBus = serviceBus;
     _serializer = serializer;
     _snapshotStore = snapshotStore;
 }
 public IoTHubTransport(ISerialize serializer, ILogger logger, IConfigurationProvider configurationProvider, IDevice device)
 {
     _serializer            = serializer;
     _logger                = logger;
     _configurationProvider = configurationProvider;
     _device                = device;
 }
Esempio n. 20
0
 public void Write(ISerialize serialize, TraceResult traceResult)
 {
     using (Stream console = Console.OpenStandardOutput())
     {
         serialize.Serialize(console, traceResult);
     }
 }
Esempio n. 21
0
        public void _headSerialize(ISerialize nSerialize)
        {
            nSerialize._serialize(ref mType, @"type");
            List <Strings> strings = new List <Strings>();

            nSerialize._serialize(ref strings, @"strings");
        }
Esempio n. 22
0
 public void Write(ISerialize serialize, TraceResult traceResult)
 {
     using (var fileStream = new FileStream(filename, FileMode.Create))
     {
         serialize.Serialize(fileStream, traceResult);
     }
 }
Esempio n. 23
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mClass, @"class");
     nSerialize._serialize(ref mName, @"name");
     nSerialize._serialize(ref mUid, @"uid");
     nSerialize._serialize(ref mImage, @"image");
 }
 public InheritedSqlPersistenceEngine(
     IConnectionFactory connectionFactory,
     ISqlDialect dialect,
     ISerialize serializer,
     TransactionScopeOption scopeOption, int pageSize) 
     : base(connectionFactory, dialect, serializer, scopeOption, pageSize)
 {}
Esempio n. 25
0
        /// <summary>
        /// 后退
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bt_agv_houtui_Click(object sender, EventArgs e)
        {
            _serialize = new ProtoClass();
            UwantAgvDevice _device = new UwantAgvDevice(port, _serialize);

            _device.SetMotionControl_houtui();
        }
Esempio n. 26
0
 public UsersController(IGet <User> users, HashFactory factory, Secret secret, ISerialize <Claims> serializer)
 {
     _users      = users;
     _factory    = factory;
     _secret     = secret;
     _serializer = serializer;
 }
Esempio n. 27
0
 public void BuildHandler(IApplicationBuilder app, ISerialize serialize)
 {
     RequestDelegateFactory.CreateDelegate(logger, messageHandler, out List <SubscribeModel> subDelegate).ForEach(x =>
     {
         app.Map(x.Path, handle =>
         {
             handle.MapWhen(p => p.Request.Method.Equals("POST"), builder =>
             {
                 builder.Run(async ctx =>
                 {
                     using var lifetimescope = Container.BeginLifetimeScope();//每次从静态根容器引用构造一个独立的生命周期范围
                     await x.Excute(ctx, lifetimescope);
                 });
             });
         });
     });
     if (subDelegate.Any())
     {
         app.Map("/dapr/subscribe", handle => handle.Run(async ctx =>
         {
             ctx.Response.ContentType = "application/json";
             await ctx.Response.WriteAsync(serialize.SerializesJson(subDelegate));
         }));
     }
 }
Esempio n. 28
0
 public AbsoluteOrderingRavenPersistenceEngine(IDocumentStore store, ISerialize serializer, bool consistentQueries)
     : base(store, serializer, consistentQueries)
 {
     _store      = store;
     _serializer = serializer;
     _hiLoGen    = new HiLoKeyGenerator("", 1000);
 }
Esempio n. 29
0
        public UWantAGV(IPort port, ISerialize serialize, object AGVNo)
        {
            port.OnReceived += Port_OnReceived;
            _port            = port;
            _serialize       = serialize;
            _AGVNo           = byte.Parse(AGVNo.ToString());

            /*byte[] result = null;
             * try
             * {
             *  lock (_port)
             *  {
             *      _port.Write(_serialize.Serialize<OutputCommand>(new OutputCommand(_AGVNo, eSwitchNumber.StatusActiveUpload, AGV.eSwitchStates.Shut)));
             *      Thread.Sleep(300);
             *      _port.Write(_serialize.Serialize<OutputCommand>(new OutputCommand(_AGVNo, eSwitchNumber.NodeNumberActiveUpload, AGV.eSwitchStates.Shut)));
             *      Thread.Sleep(300);
             *      _port.Write(_serialize.Serialize<OutputCommand>(new OutputCommand(_AGVNo, eSwitchNumber.DispatchingHeartbeatSwitch, AGV.eSwitchStates.Shut)));
             *      Thread.Sleep(300);
             *      _port.Read(out result, 0, 20 * 3);
             *  }
             * }
             * catch(Exception ex)
             * {
             *  Logger.ErrorInfo("UWantAGV", ex);
             * }
             #if DEBUG
             * try
             * {
             *  var code = BitConverter.ToString(result).Replace('-', ' ');
             *  Logger.LogInfo($"AGV{_AGVNo}:Initial, code:{code}");
             * }
             * catch { };
             #endif
             * Update();*/
        }
Esempio n. 30
0
 private void SerializeData(ISerialize serialization, String actorPath, String employeePath, String scenePath, String filmPath)
 {
     serialization.SaveData(Person.actors, actorPath);
     serialization.SaveData(Person.employees, employeePath);
     serialization.SaveData(Scene.scenes, scenePath);
     serialization.SaveData(Film.Films, filmPath);
 }
Esempio n. 31
0
        public SqlPersistenceEngine(
            IConnectionFactory connectionFactory,
            ISqlDialect dialect,
            ISerialize serializer,
            int pageSize,
            IStreamIdHasher streamIdHasher,
            TransactionScopeOption?scopeOption = null)
        {
            if (pageSize < 0)
            {
                throw new ArgumentException(nameof(pageSize));
            }

            if (streamIdHasher == null)
            {
                throw new ArgumentNullException(nameof(streamIdHasher));
            }

            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));
            _dialect           = dialect ?? throw new ArgumentNullException(nameof(dialect));
            _serializer        = serializer ?? throw new ArgumentNullException(nameof(serializer));
            _scopeOption       = scopeOption;
            _pageSize          = pageSize;
            _streamIdHasher    = new StreamIdHasherValidator(streamIdHasher);

            Logger.LogDebug(Messages.UsingScope, _scopeOption.ToString());
        }
Esempio n. 32
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mPoint, "point");
     nSerialize._serialize(ref mSize, "size");
     nSerialize._serialize(ref mText, "text");
     base._serialize(nSerialize);
 }
    public static void Initialize(ISerialize serializer)
    {
        // migrate
        // force Mhd if it exists, then rename it
        var mhdFn = Files.GetConfigFilename(forceMhd: true);

        if (File.Exists(mhdFn))
        {
            MigrateToSerializer(mhdFn, serializer);
        }

        var fn = Files.GetConfigFilename(forceMhd: false);

        if (File.Exists(fn) && fn.EndsWith(".json"))
        {
            try
            {
                var value = serializer.Deserialize <ConfigData>(File.ReadAllText(fn));
                ConfigData._current = value;
            }
            catch
            {
                MessageBox.Show("Failed to load json config, falling back to mhd");
            }
        }
        else
        {
            ConfigData._current = new ConfigData(deserializing: false, iFilename: Files.GetConfigFilename(forceMhd: true));
        }
        ConfigData._current.IntializeComponent();

        //configData = ConfigData._current = new ConfigData(
    }
 public IotHubTransportFactory(ISerialize serializer, ILogger logger,
     IConfigurationProvider configurationProvider)
 {
     _serializer = serializer;
     _logger = logger;
     _configurationProvider = configurationProvider;
 }
Esempio n. 35
0
 public IotHubTransportFactory(ISerialize serializer, ILogger logger,
                               IConfigurationProvider configurationProvider)
 {
     _serializer            = serializer;
     _logger                = logger;
     _configurationProvider = configurationProvider;
 }
Esempio n. 36
0
        //protected Thread
        public VulcanizeDevice(IPort port, ISerialize serialize) : base(port, serialize)
        {
            try
            {
                lock (_port)
                {
                    _port.Write(_serialize.Serialize(new ReadRandomCommand(eElementCode.M, 5 * 16)))
                    .Read(out byte[] result);
                    var res = _serialize.Deserialize <ReadRandomResult>(result);
                    if (res.Code == ePlcResultCode.OK)
                    {
                        _option = (eVulcanizeOption)res.WordData;
                    }
                }
            }
            catch (Exception ex) {
                Logger.ErrorInfo("VulcanizeDevice  读取状态", ex);
            }
            _isOnline = true;

            Reset(true); Thread.Sleep(1000);
            Reset(false);

            Update();
        }
Esempio n. 37
0
        private void button2_Click(object sender, EventArgs e)
        {
            IPort port = new TcpPort("" + this.tb_ip.Text.ToString().Trim() + ":" + this.tb_port.Text.ToString().Trim() + "");

            _serialize = new ProtoClass();
            TestDevice   _device  = new TestDevice(port, _serialize);
            eElementCode testenum = (eElementCode)Enum.Parse(typeof(eElementCode), cmb_in_type.SelectedValue.ToString(), false);

            //ushort content = ushort.Parse(this.tb_in_Content.ToString().Trim());
            while (true)
            {
                if ("0" == _device.Read(eElementCode.Y, uint.Parse("1")).ToString().Trim())
                {
                    Thread.Sleep(100);
                    _device.Write(eElementCode.Y, uint.Parse("1"), ushort.Parse("1"));
                }

                Thread.Sleep(100);
                if ("1" == _device.Read(eElementCode.M, uint.Parse("1")).ToString().Trim())
                {
                    _device.Write(eElementCode.Y, uint.Parse("1"), ushort.Parse("0"));
                    Thread.Sleep(100);
                }
            }
        }
 public IoTHubTransport(ISerialize serializer, ILogger logger, IConfigurationProvider configurationProvider, IDevice device)
 {
     _serializer = serializer;
     _logger = logger;
     _configurationProvider = configurationProvider;
     _device = device;
 }
Esempio n. 39
0
 public static Snapshot GetSnapshot(this IDataRecord record, ISerialize serializer)
 {
     return new Snapshot(
         record[StreamIdIndex].ToGuid(),
         record[StreamRevisionIndex].ToInt(),
         serializer.Deserialize<object>(record, PayloadIndex));
 }
Esempio n. 40
0
 private void DeserializeData(ISerialize serialization, String actorPath, String employeePath, String scenePath, String filmPath)
 {
     Person.actors    = serialization.RestoreData <Actor>(actorPath);
     Person.employees = serialization.RestoreData <Employee>(employeePath);
     Scene.scenes     = serialization.RestoreData <Scene>(scenePath);
     Film.Films       = serialization.RestoreData <Film>(filmPath);
 }
Esempio n. 41
0
 public LocalProxyGenerator(IMediator mediator, IOxygenLogger logger, ISerialize serialize, CustomerInfo customerInfo)
 {
     _mediator     = mediator;
     _logger       = logger;
     _serialize    = serialize;
     _customerInfo = customerInfo;
 }
Esempio n. 42
0
 public virtual void _headSerialize(ISerialize nSerialize)
 {
     if (null != m_tHeadSerializeSlot)
     {
         this.m_tHeadSerializeSlot(nSerialize);
     }
 }
Esempio n. 43
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mA, @"a");
     nSerialize._serialize(ref mR, @"r");
     nSerialize._serialize(ref mG, @"g");
     nSerialize._serialize(ref mB, @"b");
 }
Esempio n. 44
0
        private SqlPersistenceFactory(ISerialize serializer, TransactionScopeOption scopeOption, int pageSize)
        {
            this.serializer  = serializer;
            this.scopeOption = scopeOption;

            this.PageSize = pageSize;
        }
Esempio n. 45
0
 public virtual void _headSerialize(ISerialize nSerialize)
 {
     if (null != m_tHeadSerializeSlot)
     {
         this.m_tHeadSerializeSlot(nSerialize);
     }
 }
        private SqlPersistenceFactory(ISerialize serializer, TransactionScopeOption scopeOption, int pageSize)
        {
            this.serializer = serializer;
            this.scopeOption = scopeOption;

            this.PageSize = pageSize;
        }
Esempio n. 47
0
 private SqlPersistenceFactory(ISerialize serializer, TransactionScopeOption scopeOption, IStreamIdHasher streamIdHasher, int pageSize)
 {
     _serializer     = serializer;
     _scopeOption    = scopeOption;
     _streamIdHasher = streamIdHasher ?? new Sha1StreamIdHasher();
     PageSize        = pageSize;
 }
Esempio n. 48
0
 public void _headSerialize(ISerialize nSerialize)
 {
     if (null != m_tHeadSerializeSlot)
     {
         this.m_tHeadSerializeSlot(nSerialize);
     }
     this._serialize(nSerialize);
 }
Esempio n. 49
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mTextChangedCmd, "textChangedCommand");
     nSerialize._serialize(ref mPoint, @"point");
     nSerialize._serialize(ref mSize, @"size");
     nSerialize._serialize(ref mText, @"default");
     base._serialize(nSerialize);
 }
 public CustomSqlPersistenceFactory(IConnectionFactory factory, ISerialize serializer, ISqlDialect dialect, TransactionScopeOption scopeOption, int pageSize) : base(factory, serializer, dialect, scopeOption, pageSize)
 {
     this.factory = factory;
     this.serializer = serializer;
     this.dialect = dialect;
     this.scopeOption = scopeOption;
     this.pageSize = pageSize;
 }
		private AcceptanceTestSqlPersistenceFactory(IConnectionFactory factory, ISerialize serializer, string connectionName)
			: base(factory, serializer, ResolveDialect(new ConfigurationConnectionFactory(connectionName).Settings))
		{
			var pageSize = "pageSize".GetSetting();

			if (!string.IsNullOrEmpty(pageSize))
				this.PageSize = int.Parse(pageSize);
		}
Esempio n. 52
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mId, @"id");
     nSerialize._serialize(ref mMail, @"mail");
     nSerialize._serialize(ref mName, @"name");
     nSerialize._serialize(ref mTagUrl, @"tag");
     nSerialize._serialize(ref mImageUrl, @"imageUrl");
 }
Esempio n. 53
0
File: Uid.cs Progetto: zyouhua/nvwa
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mIsInclude, @"isInclude");
     nSerialize._serialize(ref mForceUsed, @"forceUsed");
     nSerialize._serialize(ref mOptimal, @"optimal");
     nSerialize._serialize(ref mInclude, @"include");
     nSerialize._serialize(ref mName, @"id");
 }
Esempio n. 54
0
 public override void _headSerialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mTextClass, @"files");
     nSerialize._serialize(ref mTextDirs, "dirs");
     nSerialize._serialize(ref mProjectName, "projectName");
     nSerialize._serialize(ref mReference, "reference", mReference);
     base._headSerialize(nSerialize);
 }
Esempio n. 55
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mOnClick, @"onClick");
     nSerialize._serialize(ref mEnable, "enable", true);
     nSerialize._serialize(ref mPoint, @"point");
     nSerialize._serialize(ref mSize, "size");
     nSerialize._serialize(ref mText, @"text");
     base._serialize(nSerialize);
 }
Esempio n. 56
0
 public static RavenSnapshot ToRavenSnapshot(this Snapshot snapshot, ISerialize serializer)
 {
     return new RavenSnapshot
     {
         StreamId = snapshot.StreamId,
         StreamRevision = snapshot.StreamRevision,
         Payload = serializer.Serialize(snapshot.Payload)
     };
 }
Esempio n. 57
0
 public override void _serialize(ISerialize nSerialize)
 {
     nSerialize._serialize(ref mStreamName, @"streamName");
     nSerialize._serialize(ref mStyleName, @"styleName");
     nSerialize._serialize(ref mImageUrl, @"imageUrl");
     nSerialize._serialize(ref mDraw, @"draw");
     nSerialize._serialize(ref mMoveDraw, @"moveDraw");
     nSerialize._serialize(ref mFont, "font");
 }
Esempio n. 58
0
 public NetworkPlayerPortal(IMessageQueue<IncomingGameMessageQueueItem> inQ, IMessageQueue<OutgoingGameMessageQueueItem> outQ, ISerialize iSerializer)
 {
     m_qIncomingQueue = inQ;
     m_qOutgoingQueue = outQ;
     m_bIsRunning = false;
     m_slrSerializer = iSerializer;
     m_tcGameFlow = new ThreadController(false);
     m_dicStorage = new Dictionary<string, object>();
 }
        public static Snapshot GetSnapshot(this IDataRecord record, ISerialize serializer, string streamIdOriginal)
        {
            Logger.Verbose(Messages.DeserializingSnapshot);

            return new Snapshot(
                record[BucketIdIndex].ToString(),
                streamIdOriginal,
                record[StreamRevisionIndex].ToInt(),
                serializer.Deserialize<object>(record, PayloadIndex));
        }
Esempio n. 60
0
        public static List<EventMessage> ToEventList(this BsonValue value, ISerialize serializer)
        {
            if (serializer == null)
                return new List<EventMessage>();

            if (!(serializer is MongoSerializer))
                return serializer.Deserialize<List<EventMessage>>(value.AsByteArray);

            return value.AsBsonArray.Select(item => BsonSerializer.Deserialize<EventMessage>(item.AsBsonDocument)).ToList();
        }