当前位置: 首页>>代码示例>>C#>>正文


C# BinaryOperator.ToString方法代码示例

本文整理汇总了C#中BinaryOperator.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryOperator.ToString方法的具体用法?C# BinaryOperator.ToString怎么用?C# BinaryOperator.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BinaryOperator的用法示例。


在下文中一共展示了BinaryOperator.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FormatBinaryOperator

 private void FormatBinaryOperator(BinaryOperator op, bool withParenthesis)
 {
     operators.Push(op);
     if (withParenthesis) { _resultBuilder.Append("("); }
     op.LeftOperand.Accept(this);
     _resultBuilder.AppendFormat(op.ToString());
     op.RightOperand.Accept(this);
     if (withParenthesis) { _resultBuilder.Append(")"); }
     operators.Pop();
 }
开发者ID:FreeApophis,项目名称:ArithmeticParser,代码行数:10,代码来源:MinimalParenthesisVisitor.cs

示例2: GetBinaryOperator

        /// <summary>
        /// Returns a binary operator corresponding to a certain label.
        /// </summary>
        /// <param name="Label">The label of the operator.</param>
        /// <returns>A binary operator object.</returns>
        public ABinaryOperator GetBinaryOperator(BinaryOperator Label)
        {
            ABinaryOperator baseOperator;

            try
            {
                baseOperator = Operators.Single(item => item.Value.Label == Label).Value;

                if (baseOperator == null)
                    throw new GraphDBException(new Error_OperatorDoesNotExist(Label.ToString()));
            }
            catch (Exception e)
            {
                throw new GraphDBException(new Error_UnknownDBError(e));
            }

            return baseOperator;
        }
开发者ID:Vadi,项目名称:sones,代码行数:23,代码来源:DBPluginManager.cs

示例3: ToString

		static string ToString (BinaryOperator op)
		{
			switch (op) {
			case BinaryOperator.LogicalAnd: return "&&";
			case BinaryOperator.LogicalOr: return "||";
			case BinaryOperator.Add: return "+";
			case BinaryOperator.Subtract: return "-";
			case BinaryOperator.Multiply: return "*";
			case BinaryOperator.Divide: return "/";
			case BinaryOperator.ValueEquality: return "==";
			case BinaryOperator.ValueInequality: return "!=";
			case BinaryOperator.LessThan: return "<";
			case BinaryOperator.LessThanOrEqual: return "<=";
			case BinaryOperator.GreaterThan: return ">";
			case BinaryOperator.GreaterThanOrEqual: return ">=";
			case BinaryOperator.RightShift: return ">>";
			case BinaryOperator.LeftShift: return "<<";
			case BinaryOperator.BitwiseAnd: return "&";
			case BinaryOperator.BitwiseOr: return "|";
			case BinaryOperator.BitwiseXor: return "^";
			case BinaryOperator.Modulo: return "%";
			}
			throw new ArgumentException (op.ToString (), "op");
		}
开发者ID:transformersprimeabcxyz,项目名称:cecil-old,代码行数:24,代码来源:ExpressionPrinter.cs

示例4: WriteBinaryOperator

            private void WriteBinaryOperator(BinaryOperator operatorType, IFormatter formatter)
            {
                switch (operatorType)
                {
                    case BinaryOperator.Add:
                        formatter.Write("+");
                        break;

                    case BinaryOperator.Subtract:
                        formatter.Write("-");
                        break;

                    case BinaryOperator.Multiply:
                        formatter.Write("*");
                        break;

                    case BinaryOperator.Divide:
                        formatter.WriteKeyword("/");
                        break;

                    case BinaryOperator.Modulus:
                        formatter.WriteKeyword("%");
                        break;

                    case BinaryOperator.ShiftLeft:
                        formatter.WriteKeyword("<<");
                        break;

                    case BinaryOperator.ShiftRight:
                        formatter.WriteKeyword(">>");
                        break;

                    case BinaryOperator.ValueInequality:
                    case BinaryOperator.IdentityInequality:
                        formatter.Write("!==");
                        break;

                    case BinaryOperator.ValueEquality:
                    case BinaryOperator.IdentityEquality:
                        formatter.Write("===");
                        break;

                    case BinaryOperator.BitwiseOr:
                        formatter.WriteKeyword("|");
                        break;

                    case BinaryOperator.BitwiseAnd:
                        formatter.WriteKeyword("&");
                        break;

                    case BinaryOperator.BitwiseExclusiveOr:
                        formatter.WriteKeyword("^");
                        break;

                    case BinaryOperator.BooleanOr:
                        formatter.WriteKeyword("||");
                        break;

                    case BinaryOperator.BooleanAnd:
                        formatter.WriteKeyword("&&");
                        break;

                    case BinaryOperator.LessThan:
                        formatter.Write("<");
                        break;

                    case BinaryOperator.LessThanOrEqual:
                        formatter.Write("<=");
                        break;

                    case BinaryOperator.GreaterThan:
                        formatter.Write(">");
                        break;

                    case BinaryOperator.GreaterThanOrEqual:
                        formatter.Write(">=");
                        break;

                    default:
                        throw new NotSupportedException(operatorType.ToString());
                }
            }
开发者ID:jorik041,项目名称:JavaScriptLanguage,代码行数:82,代码来源:JavaScriptLanguage.cs

示例5: SetupFilters

        // Настраиваем фильтры в зависимости от подключенных модулей обследований
        // http://www.devexpress.com/Support/Center/Question/Details/Q449767
        // http://www.devexpress.com/Support/Center/p/Q390692.aspx
        protected override void SetupFilters()
        {
            // создаем фильтры для представления с объектами IExamination
            if ((View is ListView) & (View.ObjectTypeInfo.Type == typeof(IExamination)))
            {
                IModelListViewFilters filters = (View.Model as IModelListViewFilter).Filters;
                filters.ClearNodes();

                List<CriteriaOperator> criterias = new List<CriteriaOperator>();
                IModelListViewFilterItem item = null;

                // фильтр настраивается в зависимости от подключенных плагинов
                foreach (IDynamicModule module in WindowsFormsModule.DynamicModuleManager.EnumModules())
                {
                    // для каждого модуля получаем список ModuleAssociationAttribute
                    foreach (var attribute in GetModuleAssociationAttibute(module))// добавляем в критерии фильтра идентификаторы обследований
                    {
                        // создаем критерии фильтрации по идентификатору модуля, в котором выполнялось обследование
                        CriteriaOperator criteria = new BinaryOperator("ExaminationSoftType.ExaminationSoftTypeId", attribute.OID, BinaryOperatorType.Equal);

                        item = filters.AddNode<IModelListViewFilterItem>(attribute.Association);
                        item.Criteria = criteria.ToString();
                        item.Caption = attribute.Association;
                        item.Description = "";

                        filters.CurrentFilter = item;

                        criterias.Add(criteria);
                    }
                }
                // Сводный фильтр, все подключенные модули
                if (criterias.Count > 0)
                {
                    item = filters.AddNode<IModelListViewFilterItem>("AllModules");
                    item.Criteria = CriteriaOperator.Or(criterias).ToString();
                    item.Caption = CaptionHelper.GetLocalizedText("Enums", "AllModules");//"All Modules";
                    item.Description = "";

                    filters.CurrentFilter = item;
                }
            }
            base.SetupFilters();
        }
开发者ID:Rukhlov,项目名称:DataStudio,代码行数:46,代码来源:CustomFilterController.cs


注:本文中的BinaryOperator.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。