Exemplo n.º 1
0
 /// <summary>
 /// 文字列設定。
 /// </summary>
 public void SetDocument(string text)
 {
     using (var reader = new TextLinesReader(new StringReader(text)))
     {
         _doc.SetDocument(reader.ReadLines());
     }
 }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 internal static TextLine[] ToLineModels(string text)
 {
     using (var reader = new TextLinesReader(new StringReader(text)))
     {
         return(reader.ReadLines()
                .Select(line => new TextLine(line))
                .ToArray());
     }
 }
Exemplo n.º 3
0
        public BlockImpTextPresenter(TextLinesReader storage)
        {
            var blNames         = new List <string>(Geo7App.DefPointBlockNames);
            var existingBlNames = Ac.GetBlockNames(false, true);

            foreach (var blName in existingBlNames)
            {
                if (!blNames.Contains(blName))
                {
                    blNames.Add(blName);
                }
            }

            this.BlockNames = blNames; // WinForms BindingSource accepts only IList or IListSource
            this.BlockName  = this.BlockNames.FirstOrDefault();

            this.Storage    = storage;
            this.FileName   = System.IO.Path.GetFileName(Storage.Path);
            this.SampleLine = storage.GetSampleLine();

            OnSettingsChanged();
        }