Пример #1
0
        public static void objBroadCastProcessor_OnBroadCastRecievedNew(ScripDetails objScripDetails)
        {
            try
            {
                int scripCode = objScripDetails.ScriptCode;
                //ScripDetails objScripDetails = BroadcastMasterMemory.objScripDetailsConDict.Where(x => x.Key == scripCode).Select(x => x.Value).FirstOrDefault();
                if (objScripDetails != null && ObjTouchlineDataCollection.Count > 0)
                {
                    List <int> list = new List <int>();
                    list = ObjTouchlineDataCollection.Where(i => i.Scriptcode1 == scripCode).Select(x => ObjTouchlineDataCollection.IndexOf(x)).ToList();

                    for (int i = 0; i < list.Count; i++)
                    {
                        UpdateGrid(list[i], objScripDetails);
                    }
                }
                // BestFiveVM.objBroadCastProcessor_OnBroadCastRecieved(scripCode);
            }
            catch (Exception ex)
            {
                ExceptionUtility.LogError(ex);
                return;
            }
        }
Пример #2
0
        private static List <int> CookTouchLineData(string name)
        {
            List <int> objScripCodeFromSettingsSendLst = new List <int>();

            //int ScripCode = 0;
            string[] strArray;
            try
            {
                if (name == null)
                {
                    strArray = ObjCommon.ReaDFromCSV();
                }
                else
                {
                    string UserDefinedPath = Path.Combine(masterPath.ToString(), name);
                    strArray = File.ReadAllLines(UserDefinedPath + ".csv");
                }
                SubscribeScripMemory.objSubscribeScrip.Clear();
                SubscribeList.SubscribeScrip s = new SubscribeScrip();
                //strArray.GetLength(0);
                for (int i = 0; i < strArray.GetLength(0); i++)
                {
                    string[] strArray2 = strArray[i].Split(new char[] { ',' });
                    if (strArray2.Length == 2)
                    {
                        objScripCodeFromSettingsSendLst.Add(Convert.ToInt32(strArray2[1]));
                    }
                    else
                    {
                        objScripCodeFromSettingsSendLst.Add(Convert.ToInt32(CommonFunctions.GetScripCode(strArray2[0])));
                    }
                    MarketWatchModel item     = new MarketWatchModel();
                    ScripDetails     objscrip = new ScripDetails();
                    item.Index     = i;
                    item.ScriptId1 = strArray2[0];
                    if (strArray2.Length == 2)
                    {
                        item.Scriptcode1 = Convert.ToInt32(strArray2[1]);
                    }
                    else
                    {
                        item.Scriptcode1 = Convert.ToInt32(CommonFunctions.GetScripCode(strArray2[0]));
                    }
                    DecimalPnt = CommonFunctions.GetDecimal(item.Scriptcode1);
                    //DecimalPoint =  CommonFunctions.GetDecimal(item.Scriptcode1),
                    //objscrip = BroadcastMasterMemory.objScripDetailsConDict.Where(x => x.Key == item.Scriptcode1).Select(x => x.Value).FirstOrDefault();
                    s.ScripCode_l  = item.Scriptcode1;
                    s.UpdateFlag_s = 1;
                    if (SubscribeScripMemory.objSubscribeScrip.ContainsKey(s.ScripCode_l))
                    {
                    }
                    else
                    {
                        SubscribeScripMemory.objSubscribeScrip.TryAdd(s.ScripCode_l, s);
                    }
                    BroadcastReceiver.ScripDetails Br = BroadcastMaster.BroadcastMasterMemory.objScripDetailsConDict.Where(x => x.Key == item.Scriptcode1).Select(x => x.Value).FirstOrDefault();
                    objscrip            = MainWindowVM.UpdateScripDataFromMemory(Br);
                    objscrip.ScriptCode = item.Scriptcode1;
                    Initialize_Fields(objscrip, ref item, DecimalPnt, item.Scriptcode1);
                    ObjTouchlineDataCollection.Add(item);
                    objBroadCastProcessor_OnBroadCastRecievedNew(objscrip);
                }
            }
            catch (Exception ex)
            {
                ExceptionUtility.LogError(ex);
            }
            SearchTemplist = ObjTouchlineDataCollection.Cast <MarketWatchModel>().ToList();
            return(objScripCodeFromSettingsSendLst);
        }