Пример #1
0
        public void Add(string name, long value)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(NmqiTools.Left(Convert.ToString(value), 1));
            builder.Append(NmqiTools.Left(" (hex ", 1));
            builder.Append(value.ToString("X"));
            builder.Append(NmqiTools.Left(")", 1));
            this.AddField("", "", name, builder.ToString());
        }
Пример #2
0
        private void AddField(string lquote, string rquote, string name, string value)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(NmqiTools.Left(name, this.width1));
            builder.Append(NmqiTools.Left(":", this.width2));
            builder.Append(lquote);
            builder.Append(value);
            builder.Append(rquote);
            this.fields.Add(builder.ToString());
        }
Пример #3
0
 public void Add(string name, string[] value)
 {
     if (value != null)
     {
         StringBuilder builder = new StringBuilder();
         builder.Append(NmqiTools.Left(name, this.width1));
         builder.Append(":");
         for (int i = 0; i < value.Length; i++)
         {
             builder.Append("(" + value + ")");
         }
         this.fields.Add(builder.ToString());
     }
 }
Пример #4
0
        public void Add(string name, int[] value)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(NmqiTools.Left(name, this.width1));
            builder.Append(NmqiTools.Left(":", this.width2));
            builder.Append("(");
            for (int i = 0; i < value.Length; i++)
            {
                if (i > 0)
                {
                    builder.Append(',');
                }
                builder.Append(value[i]);
            }
            builder.Append(")");
            this.fields.Add(builder.ToString());
        }