• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Generated类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Generated的典型用法代码示例。如果您正苦于以下问题:C# Generated类的具体用法?C# Generated怎么用?C# Generated使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Generated类属于命名空间,在下文中一共展示了Generated类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Load

        /// <summary>
        ///     Initializes the Historical data package
        /// </summary>
        /// <param name="filePath">The path to the file to load</param>
        /// <param name="factory">THe factory used to create instances of the loaded file</param>
        public static History Load(string filePath, Generated.Factory factory)
        {
            History retVal = null;

            acceptor.setFactory(factory);
            if (File.Exists(filePath))
            {
                // Do not rely on XmlBFileContext since it does not care about encoding.
                // File encoding is UTF-8
                XmlBStringContext ctxt;
                using (StreamReader file = new StreamReader(filePath))
                {
                    ctxt = new XmlBStringContext(file.ReadToEnd());
                    file.Close();
                }

                try
                {
                    retVal = acceptor.accept(ctxt) as History;
                }
                catch (XmlBException excp)
                {
                    Log.Error(ctxt.errorMessage());
                }
            }

            return retVal;
        }
开发者ID:JamesOakey,项目名称:ERTMSFormalSpecs,代码行数:33,代码来源:HistporyUtils.cs


示例2: GetRepresentations

 private static RepresentationCollection<Representation> GetRepresentations(Generated.RepresentationSystem representationSystem)
 {
     var numericRepresentations = representationSystem.Representations.NumericRepresentation.Select(v => new NumericRepresentation(v));
     var enumeratedRepresentations = representationSystem.Representations.EnumeratedRepresentation.Select(d => new EnumeratedRepresentation(d));
     var allRepresentations = numericRepresentations.Union<Representation>(enumeratedRepresentations);
     return new RepresentationCollection<Representation>(allRepresentations);
 } 
开发者ID:IndalecioLantis,项目名称:ADAPT-1,代码行数:7,代码来源:RepresentationManager.cs


示例3: compareCase

        /// <summary>
        /// Compares two Case and annotates the differences on the first one
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void compareCase(Generated.Case obj, Generated.Case other, VersionDiff diff)
        {
            if ( other == null )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) );
                return;
            }

            compareNamable (obj, other, diff);

            if ( obj.allPreConditions() != null )
            {
                if ( other.allPreConditions() != null )
                {
                    int i = 0;
                    while ( i < obj.countPreConditions() && i < other.countPreConditions() )
                    {
                        Generated.PreCondition element = obj.getPreConditions( i );
                        Generated.PreCondition otherElement = other.getPreConditions( i );
                        comparePreCondition ( element, otherElement, diff );
                        i += 1;
                    }
                    while ( i < obj.countPreConditions() )
                    {
                        diff.appendChanges ( new Diff(obj.getPreConditions(i), HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "PreConditions", "", obj.getPreConditions( i ).Name ) );
                        i += 1;
                    }
                    while ( i < other.countPreConditions() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove, "PreConditions", other.getPreConditions( i ).Name) );
                        i += 1;
                    }
                }
                else
                {
                    foreach ( Generated.PreCondition subElement in obj.allPreConditions() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "PreConditions", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allPreConditions() != null )
                {
                    foreach ( Generated.PreCondition otherElement in other.allPreConditions() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "PreConditions", otherElement.Name) );
                    }
                }
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getExpression(), other.getExpression()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Expression", other.getExpression(), obj.getExpression()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getComment(), other.getComment()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Comment", other.getComment(), obj.getComment()) );
            }
        }
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:65,代码来源:Comparer.cs


示例4: visit

        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.Namable obj, bool visitSubNodes)
        {
            if ( obj.getName() != null )
              {
            obj.setName(obj.getName().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:14,代码来源:Cleaner.cs


示例5: visit

            public override void visit(Generated.Paragraph obj, bool visitSubNodes)
            {
                Paragraph paragraph = (Paragraph) obj;

                while (paragraph.RequirementSetReferences.Count > 0)
                {
                    RequirementSetReference reference = (RequirementSetReference) paragraph.RequirementSetReferences[0];
                    reference.Delete();
                }

                base.visit(obj, visitSubNodes);
            }
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:12,代码来源:RequirementSetReference.cs


示例6: visit

        public override void visit(Generated.Action obj, bool visitSubNodes)
        {
            Rules.Action action = (Rules.Action)obj;

            if (Rebuild)
            {
                action.Statement = null;
            }

            // Side effect : compiles or recompiles the statement
            DataDictionary.Interpreter.Statement.Statement statement = action.Statement;

            base.visit(obj, visitSubNodes);
        }
开发者ID:Assmann-Siemens,项目名称:ERTMSFormalSpecs,代码行数:14,代码来源:Compiler.cs


示例7: Transaction

        public Transaction(KeyPair sourceAccount, long sequenceNumber, Operation[] operations, Generated.Memo memo)
        {
            SourceAccount = CheckNotNull(sourceAccount, "sourceAccount cannot be null");
            SequenceNumber = CheckNotNull(sequenceNumber, "sequenceNumber cannot be null");
            mOperations = CheckNotNull(operations, "operations cannot be null");

            if (operations.Length <= 0)
            {
                throw new ArgumentException("At least one operation required");
            }

            mFee = operations.Length * BASE_FEE;
            mSignatures = new List<Generated.DecoratedSignature>();
            Memo = memo != null ? memo : Stellar.Memo.None();
        }
开发者ID:QuantozTechnology,项目名称:csharp-stellar-base,代码行数:15,代码来源:Transaction.cs


示例8: compareAction

        /// <summary>
        /// Compares two Action and annotates the differences on the first one
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void compareAction(Generated.Action obj, Generated.Action other, VersionDiff diff)
        {
            if ( other == null )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) );
                return;
            }

            if ( !CompareUtil.canonicalStringEquality(obj.getExpression(), other.getExpression()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Expression", other.getExpression(), obj.getExpression()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getComment(), other.getComment()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Comment", other.getComment(), obj.getComment()) );
            }
        }
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:22,代码来源:Comparer.cs


示例9: CaseTIdentifier

 public override void CaseTIdentifier(Generated.node.TIdentifier node)
 {
     StringBuilder name = new StringBuilder("");
     foreach (char c in node.Text)
     {
         if (c > 0xFF)
         {
             byte[] utf8Bytes = Encoding.UTF8.GetBytes(c.ToString());
             foreach (byte b in utf8Bytes)
             {
                 name.Append("U");
                 name.AppendFormat("{0:x2}", b);
             }
         }
         else
             name.Append(c);
     }
     node.Text = name.ToString();
 }
开发者ID:Whimsyduke,项目名称:GalaxyEditorPlusPlus,代码行数:19,代码来源:RenameUnicode.cs


示例10: FromXdr

 public static Operation FromXdr(Generated.Operation xdr)
 {
     var body = xdr.Body;
     Operation operation = null;
     switch (body.Discriminant.InnerValue)
     {
         case Generated.OperationType.OperationTypeEnum.CREATE_ACCOUNT:
             //operation = new CreateAccountOperation.Builder(body.CreateAccountOp).Build();
             break;
         case Generated.OperationType.OperationTypeEnum.PAYMENT:
             operation = new PaymentOperation.Builder(body.PaymentOp).Build();
             break;
         case Generated.OperationType.OperationTypeEnum.PATH_PAYMENT:
             //operation = new PathPaymentOperation.Builder(body.getPathPaymentOp()).build();
             break;
         case Generated.OperationType.OperationTypeEnum.MANAGE_OFFER:
             //operation = new ManagerOfferOperation.Builder(body.getManageOfferOp()).build();
             break;
         case Generated.OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER:
             //operation = new CreatePassiveOfferOperation.Builder(body.getCreatePassiveOfferOp()).build();
             break;
         case Generated.OperationType.OperationTypeEnum.SET_OPTIONS:
             //operation = new SetOptionsOperation.Builder(body.getSetOptionsOp()).build();
             break;
         case Generated.OperationType.OperationTypeEnum.CHANGE_TRUST:
             operation = new ChangeTrustOperation.Builder(body.ChangeTrustOp).Build();
             break;
         case Generated.OperationType.OperationTypeEnum.ALLOW_TRUST:
             //operation = new AllowTrustOperation.Builder(body.getAllowTrustOp()).build();
             break;
         case Generated.OperationType.OperationTypeEnum.ACCOUNT_MERGE:
             //operation = new AccountMergeOperation.Builder(body).build();
             break;
         default:
             throw new Exception("Unknown operation body " + body.Discriminant.InnerValue);
     }
     if (xdr.SourceAccount != null)
     {
         operation.SourceAccount = KeyPair.FromXdrPublicKey(xdr.SourceAccount.InnerValue);
     }
     return operation;
 }
开发者ID:QuantozTechnology,项目名称:csharp-stellar-base,代码行数:42,代码来源:Operation.cs


示例11: visit

        public override void visit(Generated.Frame obj, bool visitSubNodes)
        {
            Tests.Frame frame = (Tests.Frame)obj;

            if (frame != null)
            {
                checkExpression(frame, frame.getCycleDuration());

                Types.Type type = frame.CycleDuration.GetExpressionType();
                if (type != null)
                {
                    if (!frame.EFSSystem.DoubleType.Match(type))
                    {
                        frame.AddError("Cycle duration should be compatible with the Time type");
                    }
                }
            }

            base.visit(obj, visitSubNodes);
        }
开发者ID:Assmann-Siemens,项目名称:ERTMSFormalSpecs,代码行数:20,代码来源:RuleChecker.cs


示例12: GetUnitOfMeasureSystems

 private UnitOfMeasureSystemCollection GetUnitOfMeasureSystems(Generated.UnitSystem unitSystem)
 {
     var unitOfMeasureSystems = unitSystem.UnitOfMeasureSystems.Select(u => new UnitOfMeasureSystem(u, this));
     return new UnitOfMeasureSystemCollection(unitOfMeasureSystems);
 }
开发者ID:tarakreddy,项目名称:ADAPT,代码行数:5,代码来源:InternalUnitSystemManager.cs


示例13: GetUnitDimensions

 private UnitCollection<UnitDimension> GetUnitDimensions(Generated.UnitSystem unitSystem)
 {
     var unitDimensions = unitSystem.UnitDimensions.Select(u => new UnitDimension(u));
     return new UnitCollection<UnitDimension>(unitDimensions);
 }
开发者ID:tarakreddy,项目名称:ADAPT,代码行数:5,代码来源:InternalUnitSystemManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GenerationContext类代码示例发布时间:2022-05-24
下一篇:
C# GeneralTree类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap