Ejemplo n.º 1
0
        public override void Print(FieldNode node, StringBuilder sb, PrintOption opt, params object[] values)
        {
            var maxNameLength = (int)values[0];
            var maxTypeLength = (int)values[1];

            sb.Append(opt.MakeIndentSpace());

            {
                sb.AppendFormat("{0} ", node.PBLabel.ToString().ToLower());
            }

            // 类型
            {
                sb.Append(node.TypeName.PadRight(maxTypeLength + 1));
            }

            // 字段名
            {
                sb.Append(node.Name.PadRight(maxNameLength + 1));
            }


            // 序号
            {
                sb.AppendFormat("= {0}", node.Number);
            }

            // Option
            if (node.HasOption)
            {
                sb.Append("[");

                if (node.DefaultValue != "")
                {
                    switch (node.Type)
                    {
                    case FieldType.String:
                        sb.AppendFormat("default=\"{0}\"", node.DefaultValue);
                        break;

                    default:
                        sb.AppendFormat("default={0}", node.DefaultValue);
                        break;
                    }
                }

                sb.Append("]");
            }

            sb.Append(";");


            // 注释
            if (!string.IsNullOrEmpty(node.TrailingComment))
            {
                sb.AppendFormat(" //{0}", node.TrailingComment);
            }

            sb.Append("\n");
        }
Ejemplo n.º 2
0
        public string Print(PrintOption option)
        {
            var str   = FormattingHelper.FormatValue(value) ?? string.Empty;
            var stars = new string('*', str.Length);

            return($"{name}={stars}");
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Instrument, Instrument);
            fmt.AddField(LogFieldNames.BestBidPrice, BestBidPrice);
            fmt.AddField(LogFieldNames.BestBidQuantity, BestBidQuantity);
            fmt.AddField(LogFieldNames.BestOfferPrice, BestOfferPrice);
            fmt.AddField(LogFieldNames.BestOfferQuantity, BestOfferQuantity);
            fmt.AddField(LogFieldNames.TopPriceLimit, TopPriceLimit);
            fmt.AddField(LogFieldNames.BottomPriceLimit, BottomPriceLimit);
            fmt.AddField(LogFieldNames.DecimalPlaces, DecimalPlaces);
            fmt.AddField(LogFieldNames.LastPrice, LastPrice);
            fmt.AddField(LogFieldNames.LotSize, LotSize);
            fmt.AddField(LogFieldNames.PriceStep, PriceStep);
            fmt.AddField(LogFieldNames.PriceStepValue, PriceStepValue);
            fmt.AddField(LogFieldNames.Settlement, Settlement);
            fmt.AddField(LogFieldNames.PreviousSettlement, PreviousSettlement);
            fmt.AddField(LogFieldNames.TheorPrice, TheorPrice);
            fmt.AddField(LogFieldNames.Vola, Vola);
            fmt.AddField(LogFieldNames.VolaTranslatedByFeed, VolaTranslatedByFeed);
            fmt.AddField(LogFieldNames.OpenInterest, OpenInterest);
            fmt.AddField(LogFieldNames.SessionEndTime, SessionEndTime);
            return(fmt.ToString());
        }
Ejemplo n.º 4
0
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddListField(LogFieldNames.Items, accounts);
            return(fmt.ToString());
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.TransactionId, trans_id);
            fmt.AddEnumField(LogFieldNames.State, State);
            fmt.AddField(LogFieldNames.OrderNumber, order_num);
            fmt.AddField(LogFieldNames.Flags, flags);
            fmt.AddEnumField(LogFieldNames.Operation, Operation);
            fmt.AddField(LogFieldNames.BrokerRef, brokerref);
            fmt.AddField(LogFieldNames.UserId, userid);
            fmt.AddField(LogFieldNames.FirmId, firmid);
            fmt.AddField(LogFieldNames.Account, account);
            fmt.AddField(LogFieldNames.Price, price);
            fmt.AddField(LogFieldNames.Quantity, qty);
            fmt.AddField(LogFieldNames.Balance, balance);
            fmt.AddField(LogFieldNames.ClientCode, client_code);
            fmt.AddField(LogFieldNames.ExchangeCode, exchange_code);
            fmt.AddField(LogFieldNames.ActivationTime, activation_time);
            fmt.AddField(LogFieldNames.SecCode, sec_code);
            fmt.AddField(LogFieldNames.ClassCode, class_code);
            fmt.AddField(LogFieldNames.Time, datetime);
            fmt.AddField(LogFieldNames.WithdrawDatetime, withdraw_datetime);
            fmt.AddField(LogFieldNames.ValueEntryType, value_entry_type);
            fmt.AddField(LogFieldNames.RejectReason, reject_reason);
            return(fmt.ToString());
        }
Ejemplo n.º 6
0
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Code, code);
            fmt.AddField(LogFieldNames.ClassCode, classCode);
            fmt.AddField(LogFieldNames.FullCode, fullCode);
            fmt.AddField(LogFieldNames.BestBidPrice, bid);
            fmt.AddField(LogFieldNames.BestBidQuantity, bidQuantity);
            fmt.AddField(LogFieldNames.BestOfferPrice, offer);
            fmt.AddField(LogFieldNames.BestOfferQuantity, offerQuantity);
            fmt.AddField(LogFieldNames.LastPrice, last);
            fmt.AddField(LogFieldNames.PriceStepValue, priceStep);
            fmt.AddField(LogFieldNames.Time, time);
            fmt.AddField(LogFieldNames.Strike, strike);
            fmt.AddField(LogFieldNames.Vola, volatility);
            fmt.AddField(LogFieldNames.LotSize, lotsize);
            fmt.AddField(LogFieldNames.Type, optiontype);
            fmt.AddField(LogFieldNames.OptionBase, optionbase);
            fmt.AddField(LogFieldNames.TopPriceLimit, pricemax);
            fmt.AddField(LogFieldNames.BottomPriceLimit, pricemin);
            fmt.AddField(LogFieldNames.Settlement, settlement);
            fmt.AddField(LogFieldNames.OpenInterest, openinterest);
            fmt.AddField(LogFieldNames.PreviousSettlement, previousSettlement);
            fmt.AddField(LogFieldNames.StepPriceT, stepPriceT);
            fmt.AddField(LogFieldNames.StepPrice, stepPrice);
            fmt.AddField(LogFieldNames.StepPriceCl, stepPriceCl);
            fmt.AddField(LogFieldNames.StepPricePrCl, stepPricePrCl);
            fmt.AddField(LogFieldNames.StepPricePrCl, stepPricePrCl);
            fmt.AddField(LogFieldNames.EndTime, endTime);
            return(fmt.ToString());
        }
Ejemplo n.º 7
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Order, Order?.OrderExchangeId);
            return(fmt.ToString());
        }
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Instrument, instrument);
            return(fmt.ToString());
        }
Ejemplo n.º 9
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Account, AcctCode);
            return(fmt.ToString());
        }
Ejemplo n.º 10
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Account, Account);
            fmt.AddField(LogFieldNames.ClientCode, ClientCode);

            lock (syncRoot)
            {
                foreach (var property in properties)
                {
                    switch (property.Type)
                    {
                    case MoneyPositionPropertyType.Decimal:
                        fmt.AddFieldRequired(property.Name.ToLowerInvariant(), property.AsDecimal());
                        break;

                    case MoneyPositionPropertyType.String:
                        fmt.AddField(property.Name.ToLowerInvariant(), property.AsString());
                        break;
                    }
                }
            }

            return(fmt.ToString());
        }
Ejemplo n.º 11
0
        public override void Print(MessageNode node, StringBuilder sb, PrintOption opt, params object[] values)
        {
            sb.AppendFormat("message {0}\n", node.Name);
            sb.Append("{\n");

            var subopt = new PrintOption(opt);

            int maxNameLength = 0;
            int maxTypeLength = 0;

            if (node.Field.Count > 0)
            {
                maxNameLength = node.Field.Select(x => x.Name.Length).Max();
                maxTypeLength = node.Field.Select(x => x.CompleteTypeName.Length).Max();
            }

            foreach (var n in node.Child)
            {
                n.PrintVisit(this, sb, subopt,
                             maxNameLength,
                             maxTypeLength);
            }

            sb.Append("}\n");
        }
Ejemplo n.º 12
0
        public string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Id, id);
            fmt.AddListField(LogFieldNames.Items, body);
            return(fmt.ToString());
        }
Ejemplo n.º 13
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Message, Message);
            fmt.AddField(LogFieldNames.StackTrace, StackTrace);
            return(fmt.ToString());
        }
Ejemplo n.º 14
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            PrintCommonProperties(fmt);
            fmt.AddFieldRequired(LogFieldNames.ExchangeOrderId, OrderExchangeId);
            return(fmt.ToString());
        }
Ejemplo n.º 15
0
        private void PrintPreview(object sender, EventArgs e)
        {
            PrintOptions po = new PrintOptions(trv_view_exam.SelectedNode);

            po.ShowDialog();
            whatToPrint = po.SelectedPrintOption;
            ppd_print.ShowDialog();
        }
Ejemplo n.º 16
0
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddListField(LogFieldNames.Futures, FuturesCodes);
            fmt.AddListField(LogFieldNames.Options, OptionsCodes);
            return(fmt.ToString());
        }
Ejemplo n.º 17
0
        public string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Price, p);
            fmt.AddField(LogFieldNames.Quantity, q);
            return(fmt.ToString());
        }
Ejemplo n.º 18
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.TransactionId, TransactionId);
            fmt.AddField(LogFieldNames.Success, Success);
            fmt.AddField(LogFieldNames.Message, Message);
            return(fmt.ToString());
        }
Ejemplo n.º 19
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Id, conId);
            fmt.AddField(LogFieldNames.Symbol, LocalSymbol);
            fmt.AddField(LogFieldNames.Exchange, Exchange);
            return(fmt.ToString());
        }
Ejemplo n.º 20
0
        public string Print(PrintOption option)
        {
            if (suffix != null)
            {
                return($"{name}={FormattingHelper.FormatValue(value, format)}{suffix}");
            }

            return($"{name}={FormattingHelper.FormatValue(value, format)}");
        }
Ejemplo n.º 21
0
 private void btn_ok_Click(object sender, EventArgs e)
 {
     if (rdb_all_questions.Checked)
         SelectedPrintOption = PrintOption.AllQuestions;
     else if (rdb_current_question.Checked)
         SelectedPrintOption = PrintOption.CurrentQuestion;
     else
         SelectedPrintOption = PrintOption.CurrentSection;
     this.Close();
 }
Ejemplo n.º 22
0
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Id, id);
            fmt.AddField(LogFieldNames.Instrument, instrument);
            fmt.AddEnumField(LogFieldNames.Span, span);
            fmt.AddListField(LogFieldNames.Candles, candles);
            return(fmt.ToString());
        }
Ejemplo n.º 23
0
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Time, time);
            fmt.AddField(LogFieldNames.StartTime, startTime);
            fmt.AddField(LogFieldNames.EndTime, endTime);
            fmt.AddField(LogFieldNames.EveningStartTime, evnStartTime);
            fmt.AddField(LogFieldNames.EveningEndTime, evnEndTime);
            return(fmt.ToString());
        }
Ejemplo n.º 24
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Account, Account);
            fmt.AddField(LogFieldNames.Type, OrderType);
            fmt.AddField(LogFieldNames.Action, Action);
            fmt.AddField(LogFieldNames.Price, LmtPrice);
            fmt.AddField(LogFieldNames.Quantity, TotalQuantity);
            return(fmt.ToString());
        }
Ejemplo n.º 25
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Account, Account);
            fmt.AddField(LogFieldNames.ClientCode, ClientCode);
            fmt.AddField(LogFieldNames.Instrument, Instrument);
            fmt.AddField(LogFieldNames.Quantity, Quantity);
            fmt.AddField(LogFieldNames.Price, Price);
            return(fmt.ToString());
        }
Ejemplo n.º 26
0
        public string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField("t", Time);
            fmt.AddField("o", o);
            fmt.AddField("h", h);
            fmt.AddField("l", l);
            fmt.AddField("c", c);
            return(fmt.ToString());
        }
Ejemplo n.º 27
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Time, ServerTime);
            fmt.AddField(LogFieldNames.IsTrading, IsTrading);
            fmt.AddField(LogFieldNames.StartTime, StartTime);
            fmt.AddField(LogFieldNames.EndTime, EndTime);
            fmt.AddField(LogFieldNames.EveningStartTime, EveningStartTime);
            fmt.AddField(LogFieldNames.EveningEndTime, EveningEndTime);
            return(fmt.ToString());
        }
Ejemplo n.º 28
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Id, Id);
            fmt.AddField(LogFieldNames.Instrument, Instrument);
            fmt.AddField(LogFieldNames.Time, DateTime);
            fmt.AddEnumField(LogFieldNames.Operation, Operation);
            fmt.AddField(LogFieldNames.Price, Price);
            fmt.AddField(LogFieldNames.Quantity, Quantity);
            return(fmt.ToString());
        }
Ejemplo n.º 29
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.TransactionId, trans_id);
            fmt.AddField(LogFieldNames.Status, status);
            fmt.AddField(LogFieldNames.Result, result_msg);
            fmt.AddField(LogFieldNames.Time, time);
            fmt.AddField(LogFieldNames.Uid, uid);
            fmt.AddField(LogFieldNames.ServerTransactionId, server_trans_id);
            return(fmt.ToString());
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public PageSettings() {
            m_oHeader = DefaultHeader;
            m_oFooter = DefaultFooter;
            m_sFontMagification = 0;
            m_eColorMode = PrintOption.Normal;

            // Set default margins to 1/2 inch (50/100ths)
            base.Margins.Top = 50;
            base.Margins.Left = 50;
            base.Margins.Right = 50;
            base.Margins.Bottom = 50;
        }
Ejemplo n.º 31
0
        public override string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.FirmId, firmid);
            fmt.AddField(LogFieldNames.AccountId, trdaccid);
            fmt.AddField(LogFieldNames.SecCode, sec_code);
            fmt.AddField(LogFieldNames.StartNet, startnet);
            fmt.AddField(LogFieldNames.TotalNet, totalnet);
            fmt.AddField(LogFieldNames.VarMargin, varmargin);
            return(fmt.ToString());
        }
Ejemplo n.º 32
0
        /// <summary>
        ///     Вывести объект в лог
        /// </summary>
        public string Print(PrintOption option)
        {
            var fmt = ObjectLogFormatter.Create(this, option);

            fmt.AddField(LogFieldNames.Time, Point);
            fmt.AddField(LogFieldNames.Low, Low);
            fmt.AddField(LogFieldNames.High, High);
            fmt.AddField(LogFieldNames.Open, Open);
            fmt.AddField(LogFieldNames.Close, Close);
            fmt.AddField(LogFieldNames.PeriodVolume, PeriodVolume);
            fmt.AddField(LogFieldNames.OpenInterest, OpenInterest);
            return(fmt.ToString());
        }
Ejemplo n.º 33
0
 private void Print_Preview(object sender, EventArgs e)
 {
     PrintOptions po = new PrintOptions(trv_explorer.SelectedNode);
     po.ShowDialog();
     whatToPrint = po.SelectedPrintOption;
     ppd_print.ShowDialog();
 }