public void Should_be_able_to_read_text_from_string()
        {
            var readFromString = new ReadText();
            var read           = readFromString.Read();

            read.Length.Should().NotBe(null);
        }
Beispiel #2
0
        public static void PrintAllText()
        {
            IReadText  readText  = new ReadText();
            IWriteText writeText = new TextToStringWriter();
            var        text      = readText.Read().Manipulate(GetManipulatorRules());

            Console.Write(writeText.Write(text));
            Console.ReadKey();
        }
Beispiel #3
0
        /// <summary>
        /// 更新持仓单信息
        /// </summary>
        void UpdatePostion()
        {
            var click = new iAutomationElement();

            if (ZT_PositionOrder != null)
            {
                click.InvokeButton(ZT_PositionOrder);
                GetZT_OutPutElement();
                if (ZT_Output != null)
                {
                    click.InvokeButton(ZT_Output);
                    GetZT_OutPutSuessElement();
                    if (ZT_OutputSuess != null)
                    {
                        click.InvokeButton(ZT_OutputSuess);
                        Thread.Sleep(500);
                        var uielement   = new iAutomationElement();
                        var elementlist = uielement.enumRoot();
                        elementlist = uielement.FindByClassName("Notepad", elementlist);

                        uielement.CloseTextBook(elementlist[0]);
                        var list = ReadText.Read();
                        foreach (var item in list)
                        {
                            string[] array = item.Split(new char[]
                            {
                                '|'
                            });
                            var data = new DataItem();
                            data.data = array;
                            if (!ZT_DataList.ContainsKey(array[0]))
                            {
                                ZT_DataList.Add(array[0], data);
                            }
                            else
                            {
                                //若标记为空更新全部数据
                                if (ZT_DataList[array[0]].data[18] == "")
                                {
                                    ZT_DataList[array[0]] = data;
                                }
                                else
                                {
                                    data.data[18]         = "1";
                                    ZT_DataList[array[0]] = data;
                                }
                            }
                        }
                    }
                }
            }
        }