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


C# Group.Clone方法代码示例

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


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

示例1: Populate

        /// <summary>
        /// Poblado de grupo
        /// </summary>
        /// <param name="pGroup"></param>
        /// <param name="fileName"></param>
        public void Populate(Group pGroup, string fileName)
        {
            RefreshData();
            
            lblFileName.Text = fileName;
            txtGroupName.Text = pGroup.Name;
       
           _Group = pGroup.Clone<Group>();

            
        }
开发者ID:gpanayir,项目名称:sffwk,代码行数:16,代码来源:UCKey.cs

示例2: ParseWhileGroup

        /// <summary>
        /// Parses a while loop statement.
        /// </summary>
        /// <param name="group">The group to parse.</param>
        /// <returns>TNil on success, otherwise a TException.</returns>
        TType ParseWhileGroup(Group group)
        {
            /* BNF for while loop:
             *      <while-loop> ::= 'while' <condition> ',' ( <statement> | <block> )
             * The 'while' is assumed to have already been checked for
             */
            if (group.Count == 1) return new TException(this, "Statement could not be evaluated",
                "while loop must be given a condition");

            int commaIndex = group.IndexOf(",");
            if (commaIndex < 0) return new TException(this, "while loop invalid", "comma required after condition");

            if (group.Count == 1)
                return new TException(this,
                    "Statement could not be evaluated", "while loop must be given a condition");

            Group conditionGroup = new Group(null);
            conditionGroup.AddRange(group.GetRange(1, commaIndex - 1));

            Group statementGroup = null;
            TBlock block = null;
            if (group.Count > commaIndex + 1) // If there is a statement after the comma, use that statement
            {
                statementGroup = new Group(null);
                statementGroup.AddRange(group.GetRange(commaIndex + 1, group.Count - (commaIndex + 1)));
            }
            else // Otherwise get a block
            {
                TException exception;
                block = new TBlock(this, out exception, false);
                if (exception != null) return exception;
            }

            TType returnValue = TNil.Instance;
            while (true)
            {
                // Parse the condition, and if it's true run the block or single statement, otherwise return MNil
                TType value = ParseGroup((Group)conditionGroup.Clone());
                if (value is TException) return value;

                TBoolean result = value as TBoolean;
                if (result == null)
                {
                    bool success = false;
                    TVariable variable = value as TVariable;
                    if (variable != null)
                    {
                        result = variable.Value as TBoolean;
                        if (result != null) success = true;
                    }
                    if (!success)
                        return new TException(this, "Condition does not evaluate to a boolean value", "yes or no");
                }

                if (result.Value)
                {
                    bool breakUsed = false;
                    if (statementGroup != null) returnValue = ParseGroup((Group)statementGroup.Clone());
                    else
                    {
                        bool exitFromFunction;
                        returnValue = block.Execute(this, out exitFromFunction, out breakUsed);
                        if (exitFromFunction) return returnValue;
                    }
                    if ((returnValue is TException) || breakUsed) return returnValue;
                }
                else return returnValue;

                if (!alive) return TNil.Instance;
            }
        }
开发者ID:supermaximo93,项目名称:Toast-Prototype-Interpreter,代码行数:76,代码来源:Interpreter.cs

示例3: KioskGroup

 /// <summary>
 /// Initializes a new instance of the <see cref="KioskGroup" /> class.
 /// </summary>
 /// <param name="group">The group.</param>
 public KioskGroup( Group group )
     : base()
 {
     Group = group.Clone( false );
     KioskLocations = new List<KioskLocation>();
 }
开发者ID:NewSpring,项目名称:Rock,代码行数:10,代码来源:KioskGroup.cs


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