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


C# ITransaction.IsCompleted方法代码示例

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


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

示例1: ValidateTransaction

            //验证Transaction
            internal void ValidateTransaction(DefaultMessageManager manager, ITransaction parent, ITransaction transaction)
            {
                if (transaction.Standalone)
                {
                    IList<IMessage> children = transaction.Children;
                    int len = children.Count;
                    for (int i = 0; i < len; i++)
                    {
                        IMessage message = children[i];

                        if (message is ITransaction)
                        {
                            ValidateTransaction(manager, transaction, message as ITransaction);
                        }
                    }

                    if (!transaction.IsCompleted() && transaction is DefaultTransaction)
                    {
                        MarkAsNotCompleted(transaction as DefaultTransaction);
                    }
                    else if (!transaction.IsCompleted())
                    {
                        if (transaction is DefaultForkedTransaction)
                        {
                            LinkAsRunAway(manager, transaction as DefaultForkedTransaction);
                        }
                        else if (transaction is DefaultTaggedTransaction)
                        {
                            MarkAsRunAway(parent, transaction as DefaultTaggedTransaction);
                        }
                    }
                }
            }
开发者ID:chinaboard,项目名称:PureCat,代码行数:34,代码来源:DefaultMessageManager.cs

示例2: ValidateTransaction

            //验证Transaction
            internal void ValidateTransaction(ITransaction transaction)
            {
                IList<IMessage> children = transaction.Children;
                int len = children.Count;
                for (int i = 0; i < len; i++)
                {
                    IMessage message = children[i];
                    var transaction1 = message as ITransaction;
                    if (transaction1 != null)
                    {
                        ValidateTransaction(transaction1);
                    }
                }

                if (!transaction.IsCompleted())
                {
                    // missing transaction end, log a BadInstrument event so that
                    // developer can fix the code
                    IMessage notCompleteEvent = new DefaultEvent("CAT", "BadInstrument")
                                                    {Status = "TransactionNotCompleted"};
                    notCompleteEvent.Complete();
                    transaction.AddChild(notCompleteEvent);
                    transaction.Complete();
                }
            }
开发者ID:kangzhenkang,项目名称:cat.net,代码行数:26,代码来源:DefaultMessageManager.cs

示例3: Validate

            //验证Transaction
            public void Validate(ITransaction parent, ITransaction transaction)
            {
                if (transaction.Standalone)
                {
                    IList<IMessage> children = transaction.Children;
                    int len = children.Count;
                    for (int i = 0; i < len; i++)
                    {
                        IMessage message = children[i];

                        var childTransaction = message as ITransaction;
                        if (childTransaction != null)
                        {
                            Validate(transaction, childTransaction);
                        }
                    }

                    if (!transaction.IsCompleted() && transaction is DefaultTransaction)
                    {
                        // missing transaction end, log a BadInstrument event so that
                        // developer can fix the code
                        this.markAsNotCompleted((DefaultTransaction)transaction);
                    }
                }
                else if (!transaction.IsCompleted())
                {
                    if (transaction is DefaultForkedTransaction)
                    {
                        this.LinkAsRunAway((DefaultForkedTransaction)transaction);
                    }
                    else if (transaction is DefaultTaggedTransaction)
                    {
                        this.MarkAsRunAway(parent, (DefaultTaggedTransaction)transaction);
                    }
                }
            }
开发者ID:youyong205,项目名称:cat.net,代码行数:37,代码来源:DefaultMessageManager.cs


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