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"); }
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"); }
public override void _serialize(ISerialize nSerialize) { nSerialize._serialize(ref mX, @"x"); nSerialize._serialize(ref mY, @"y"); nSerialize._serialize(ref mW, @"w"); base._serialize(nSerialize); }
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); }
public static Snapshot GetSnapshot(this IDataRecord record, ISerialize serializer) { return(new Snapshot( record[StreamIdIndex].ToGuid(), record[StreamRevisionIndex].ToInt(), serializer.Deserialize <object>(record, PayloadIndex))); }
public FilesHandler(ISerialize serializer, string savePath) { currentFileID = 0; this.savePath = savePath; filesInfo = new List <FileInfo>(); this.serializer = serializer; }
public GetEventStorePersistenceEngine(Func <IEventStoreConnection> buildConnection, Action dropAction, ISerialize serializer) { _buildConnection = buildConnection; _dropAction = dropAction; _serializer = serializer; }
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; }
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()); }
/// <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()); }
private void button1_Click(object sender, EventArgs e) { _serialize = new ProtoClass(); UwantAgvDevice _device = new UwantAgvDevice(port, _serialize); _device.SetMonitor(); }
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; }
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; }
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"); }
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; }
public void Write(ISerialize serialize, TraceResult traceResult) { using (Stream console = Console.OpenStandardOutput()) { serialize.Serialize(console, traceResult); } }
public void _headSerialize(ISerialize nSerialize) { nSerialize._serialize(ref mType, @"type"); List <Strings> strings = new List <Strings>(); nSerialize._serialize(ref strings, @"strings"); }
public void Write(ISerialize serialize, TraceResult traceResult) { using (var fileStream = new FileStream(filename, FileMode.Create)) { serialize.Serialize(fileStream, traceResult); } }
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) {}
/// <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(); }
public UsersController(IGet <User> users, HashFactory factory, Secret secret, ISerialize <Claims> serializer) { _users = users; _factory = factory; _secret = secret; _serializer = serializer; }
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)); })); } }
public AbsoluteOrderingRavenPersistenceEngine(IDocumentStore store, ISerialize serializer, bool consistentQueries) : base(store, serializer, consistentQueries) { _store = store; _serializer = serializer; _hiLoGen = new HiLoKeyGenerator("", 1000); }
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();*/ }
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); }
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()); }
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; }
//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(); }
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 static Snapshot GetSnapshot(this IDataRecord record, ISerialize serializer) { return new Snapshot( record[StreamIdIndex].ToGuid(), record[StreamRevisionIndex].ToInt(), serializer.Deserialize<object>(record, PayloadIndex)); }
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); }
public LocalProxyGenerator(IMediator mediator, IOxygenLogger logger, ISerialize serialize, CustomerInfo customerInfo) { _mediator = mediator; _logger = logger; _serialize = serialize; _customerInfo = customerInfo; }
public virtual void _headSerialize(ISerialize nSerialize) { if (null != m_tHeadSerializeSlot) { this.m_tHeadSerializeSlot(nSerialize); } }
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"); }
private SqlPersistenceFactory(ISerialize serializer, TransactionScopeOption scopeOption, int pageSize) { this.serializer = serializer; this.scopeOption = scopeOption; this.PageSize = pageSize; }
public void _headSerialize(ISerialize nSerialize) { if (null != m_tHeadSerializeSlot) { this.m_tHeadSerializeSlot(nSerialize); } this._serialize(nSerialize); }
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); }
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"); }
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"); }
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); }
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); }
public static RavenSnapshot ToRavenSnapshot(this Snapshot snapshot, ISerialize serializer) { return new RavenSnapshot { StreamId = snapshot.StreamId, StreamRevision = snapshot.StreamRevision, Payload = serializer.Serialize(snapshot.Payload) }; }
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"); }
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)); }
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(); }