Beispiel #1
0
        internal void AddSymbolRTDataRow(RTDataRec rtDataRec)
        {
            RTDataRowBase RTDataRow = RTDataRows.Find(x => x.Symbol == rtDataRec.Symbol);

            if (RTDataRow == null)
            {
                switch (ClusterName)
                {
                case PGClusterNames.Equities:
                    RTDataRow = new RTEquitiesDataRow(rtDataRec.Symbol);
                    break;

                case PGClusterNames.Forex:
                    RTDataRow = new RTForexDataRow(rtDataRec.Symbol);
                    break;

                case PGClusterNames.Crypto:
                    RTDataRow = new RTCryptoDataRow(rtDataRec.Symbol);
                    break;

                default:
                    throw new Exception($"Unknown ClusterName: {ClusterName}");
                }

                RTDataRow.RowDef = new RowDefinition();
                RTDataRow.OnRTDataRowMouseDoubleClickEvent += FireOnRTDataRowMouseDoubleClick;
                RTDataRows.Add(RTDataRow);

                // binding
                RTDataRow.DataContext = rtDataRec;

                InitRTDataRows();
                SetRTClusterDataGridHeight();
            }
        }
Beispiel #2
0
        internal void RemoveSymbolRTDataRow(RTDataRec rtDataRec)
        {
            RTDataRowBase RTDataRow = RTDataRows.Find(x => x.Symbol == rtDataRec.Symbol);

            if (RTDataRow != null)
            {
                RTDataRow.OnRTDataRowMouseDoubleClickEvent -= FireOnRTDataRowMouseDoubleClick;
                RTDataRow.DataContext = null;

                RTDataRows.Remove(RTDataRow);

                InitRTDataRows();
                SetRTClusterDataGridHeight();
            }
        }