示例#1
0
 public CppThreeTextController()
 {
     FormatRules.Add(new NodeTextFormatRule(NodeType.FOR, new EditTokensFilter(FormatCommonFor)));
     FormatRules.Add(new NodeTextFormatRule(NodeType.ANY, new RemoveTokensFilter(new SingleTokenPattern(TokenType.LINE_END))));
     FormatRules.Add(new NodeTextFormatRule(NodeType.ANY, new RemoveTokensFilter(new SingleTokenPattern(TokenType.INPUT_OPERATOR))));
     FormatRules.Add(new NodeTextFormatRule(NodeType.ANY, new RemoveTokensFilter(new SingleTokenPattern(TokenType.OUTPUT_OPERATOR))));
 }
示例#2
0
        /// <summary>
        /// Создать <see cref="OptionDesk"/>.
        /// </summary>
        public OptionDesk()
        {
            InitializeComponent();

            #region Format rules

            var callColor = Color.FromArgb(255, 190, 224, 189);
            var putColor  = Color.FromArgb(255, 255, 190, 189);

            FormatRules.Add(CallRho, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(CallTheta, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(CallVega, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(CallGamma, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(CallDelta, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(CallBid, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(CallAsk, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(CallTheorPrice, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(CallVolume, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(CallOpenInterest, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(CallSecCode, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(callColor),
            });
            FormatRules.Add(Strike, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = Brushes.LightGray,
                Font       = { Weight = System.Windows.FontWeights.Bold }
            });
            FormatRules.Add(ImpliedVolatility, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = Brushes.LightGray,
            });
            FormatRules.Add(HistoricalVolatility, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = Brushes.LightGray,
            });
            FormatRules.Add(PnL, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = Brushes.LightGray,
            });
            FormatRules.Add(PutSecCode, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });
            FormatRules.Add(PutOpenInterest, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });
            FormatRules.Add(PutVolume, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });
            FormatRules.Add(PutTheorPrice, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });
            FormatRules.Add(PutBid, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });
            FormatRules.Add(PutAsk, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });
            FormatRules.Add(PutDelta, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });
            FormatRules.Add(PutGamma, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });
            FormatRules.Add(PutVega, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });
            FormatRules.Add(PutTheta, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });
            FormatRules.Add(PutRho, new FormatRule
            {
                Condition  = ComparisonOperator.Any,
                Background = new SolidColorBrush(putColor),
            });

            #endregion

            Options = Enumerable.Empty <Security>();
        }