вторник, 28 апреля 2020 г.

TCP/IP Server Client

Json/String/StringArray
Cmd/Data
Cmprs/AsIs

json/DATA/CMPRS/position/operation/Type/data
XML/DATA/CMPRS/STRATEGY/operation/TYPE/StrategyData

STR/CMD/PING/DateTime
STR/CMD/PONG/DateTime
STR/CMD/CLOSE

STR/DATA/ASIS/Quotes/QuotesData

Data/RouteKey/Entity/Operation/EntityData/Fmt/Doc/Cmprs/Typeof/
Cmd/Ping/DateTeme

Fmt: json,xml,str
Doc/Class/Txt

Data/Tickers/Quotes/New/BidAsk/Str
Data/Tickers/Quotes/New/BidAsk/xml/class/Asis/Tickers.Quote
Data/Tickers/Quotes/New/BidAsk/json/class/Asis/Tickers.Quote

суббота, 18 апреля 2020 г.

Element32

public abstract class Element32<TKey, TEventArgs, TList, TItem> 
                                : Element3<TKey, TEventArgs> , IElement2<TKey, TItem>, IHaveUri
        where TItem : class, IElement1<TKey>, IHaveKey<TKey> //, IHaveInit
        // where TItem : class, IHaveKey<TKey> // , IHaveInit
        where TList : IContainer<TKey, TItem>
        where TEventArgs : IEventArgs
        //where TList : ICollection<TItem>
    {
        [XmlIgnore]
        public TList Collection;

        public IEnumerable<TItem> Items => Collection.Items;

        public string Uri { get; set; }
        public string XPath { get; set; }
        public string UriXPath => Uri + "@" + XPath;


        public override void Init(IEventLog evl)

----------------------------------------------------------------
public class EventHub3 : Element32<string,  IEventArgs, DictionaryContainer<string, EventHubItem3>, EventHubItem3>
    {
        //public bool IsQueueEnabled { get; set; }
        public List<EventHubItem3> EventHubItems { get; set; }

        // protected EventArgsQueue Queue;
        private readonly object _locker;

        public EventHub3()
        {
            EventHubItems = new List<EventHubItem3>();
            Collection = new DictionaryContainer<string, EventHubItem3>();
            //Queue = new EventArgsQueue();
            _locker = new object();
        }
------------------------------------------------------------
public class TaskProcess02 : Element32<string,  IEventArgs1,
        DictionaryContainer<string, UnitOfWork>, UnitOfWork>
    {
        //public bool IsQueueEnabled { get; set; }
        public List<EventHubItem3> EventHubItems { get; set; }

        // protected EventArgsQueue Queue;
        private readonly object _locker;

        protected ProcessTask02 Task { get; set; }

        public TaskProcess02()
        {
            EventHubItems = new List<EventHubItem3>();
            Collection = new DictionaryContainer<string, UnitOfWork>();
            Task = new ProcessTask02 { Parent = this, TimeInterval = 5000 };
            //Queue = new EventArgsQueue();
            _locker = new object();

        }

Element21

Element21

public class TradeStorage21 : Element21<string, ITradeStorage, Containers5.DictionaryContainer<string, ITradeStorage>>, ITradeStorage
    {
        public TradeStorage21()
        {            
            Collection = new DictionaryContainer<string, ITradeStorage>();

        }