Esempio n. 1
0
        /// <summary>
        /// Prints a single line on to current block.
        /// </summary>
        /// <param name="entryText">
        /// This is broken into many lines whenever the text is too large.</param>
        /// <param name="pl">Lets the caller determine the <see cref="PrintLocation"/> of this line</param>
        /// <returns></returns>
        public virtual FastPlate Txt(string entryText, PrintLocation pl = PrintLocation.Center)
        {
            if (_liveBlock == null)
            {
                return(this);
            }
            entryText = entryText ?? string.Empty;

            var entryLine = new List <string>();

            foreach (var word in entryText.Split(' '))
            {
                entryLine.Add(word);
                if (string.Join(" ", entryLine).Length + 4 <= _liveBlock.Width)
                {
                    continue;
                }
                _liveBlock.AddEntry(_lineCounter, string.Join(" ", entryLine), pl);
                _lineCounter += 1;
                entryLine.Clear();
            }

            _liveBlock.AddEntry(_lineCounter, string.Join(" ", entryLine), pl);
            _lineCounter += 1;

            AdjustRuler();

            return(this);
        }
Esempio n. 2
0
        private static void readPrintLocations()
        {
            string[] locations = File.ReadAllLines(@"C:\AppFiles\printcoord.txt");

            for (int i = 0; i < locations.Length; i++)
            {
                PrintLocation loc  = new PrintLocation();
                string[]      temp = locations[i].Split(':');
                loc.Name      = temp[0];
                loc.Latitude  = double.Parse(temp[1]);
                loc.Longitude = double.Parse(temp[2]);
                LocationAPI.AddPrintLocation(loc);
            }
        }
Esempio n. 3
0
        public virtual string Execute(string[] args)
        {
            var attribute = this.MetadataController.GetAttribute(typeof(Weapon));

            var metadataValues = MetadataController.GetAttributeValues(attribute);

            var pair = metadataValues.FirstOrDefault(mdv => mdv.Key == this.GetType().Name);

            if (!pair.Equals(default(KeyValuePair <string, object>)))
            {
                PrintLocation.Print(PairOutput(pair) + Environment.NewLine);
            }

            return(null);
        }
Esempio n. 4
0
 public virtual void AddEntry(double startValue, double endValue, string text, PrintLocation location)
 {
     AddEntry(new PeriodEntry {
         StartValue = startValue, EndValue = endValue, Text = text, Location = location
     });
 }
Esempio n. 5
0
 public virtual void AddEntry(double startValue, string text, PrintLocation location)
 {
     AddEntry(new SimpleFactEntry {
         StartValue = startValue, Text = text, Location = location
     });
 }
Esempio n. 6
0
 public virtual void AddEntry(double startValue, double endValue, string text, PrintLocation location)
 {
     AddEntry(new Entry { StartValue = startValue, EndValue = endValue, Text = text, Location = location });
 }
Esempio n. 7
0
        /// <summary>
        /// Prints a single line on to current block.
        /// </summary>
        /// <param name="entryText">
        /// This is broken into many lines whenever the text is too large.</param>
        /// <param name="pl">Lets the caller determine the <see cref="PrintLocation"/> of this line</param>
        /// <returns></returns>
        public virtual FastPlate Txt(string entryText, PrintLocation pl = PrintLocation.Center)
        {
            if (_liveBlock == null)
                return this;
            entryText = entryText ?? string.Empty;

            var entryLine = new List<string>();

            foreach (var word in entryText.Split(' '))
            {
                entryLine.Add(word);
                if (string.Join(" ", entryLine).Length + 4 <= _liveBlock.Width)
                    continue;
                _liveBlock.AddEntry(_lineCounter, string.Join(" ", entryLine),pl);
                _lineCounter += 1;
                entryLine.Clear();
            }

            _liveBlock.AddEntry(_lineCounter, string.Join(" ", entryLine), pl);
            _lineCounter += 1;

            AdjustRuler();

            return this;
        }