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


C# SBase.clone方法代码示例

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


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

示例1: testClone

        static void testClone(SBase s)
        {
            string ename = s.getElementName();
              SBase c = s.clone();

              if ( c is Compartment ) { Compartment x = (s as Compartment).clone(); c = x; }
              else if ( c is CompartmentType ) { CompartmentType x = (s as CompartmentType).clone(); c = x; }
              else if ( c is Constraint ) { Constraint x = (s as Constraint).clone(); c = x; }
              else if ( c is Delay ) { Delay x = (s as Delay).clone(); c = x; }
              else if ( c is Event ) { Event x = (s as Event).clone(); c = x; }
              else if ( c is EventAssignment ) { EventAssignment x = (s as EventAssignment).clone(); c = x; }
              else if ( c is FunctionDefinition ) { FunctionDefinition x = (s as FunctionDefinition).clone(); c = x; }
              else if ( c is InitialAssignment ) { InitialAssignment x = (s as InitialAssignment).clone(); c = x; }
              else if ( c is KineticLaw ) { KineticLaw x = (s as KineticLaw).clone(); c = x; }
              // currently return type of ListOf::clone() is SBase
              else if ( c is ListOf ) { SBase x = (s as ListOf).clone(); c = x; }
              else if ( c is Model ) { Model x = (s as Model).clone(); c = x; }
              else if ( c is Parameter ) { Parameter x = (s as Parameter).clone(); c = x; }
              else if ( c is Reaction ) { Reaction x = (s as Reaction).clone(); c = x; }
              else if ( c is AlgebraicRule ) { AlgebraicRule x = (s as AlgebraicRule).clone(); c = x; }
              else if ( c is AssignmentRule ) { AssignmentRule x = (s as AssignmentRule).clone(); c = x; }
              else if ( c is RateRule ) { RateRule x = (s as RateRule).clone(); c = x; }
              else if ( c is SBMLDocument ) { SBMLDocument x = (s as SBMLDocument).clone(); c = x; }
              else if ( c is Species ) { Species x = (s as Species).clone(); c = x; }
              else if ( c is SpeciesReference ) { SpeciesReference x = (s as SpeciesReference).clone(); c = x; }
              else if ( c is SpeciesType ) { SpeciesType x = (s as SpeciesType).clone(); c = x; }
              else if ( c is SpeciesReference ) { SpeciesReference x = (s as SpeciesReference).clone(); c = x; }
              else if ( c is StoichiometryMath ) { StoichiometryMath x = (s as StoichiometryMath).clone(); c = x; }
              else if ( c is Trigger ) { Trigger x = (s as Trigger).clone(); c = x; }
              else if ( c is Unit ) { Unit x = (s as Unit).clone(); c = x; }
              else if ( c is UnitDefinition ) { UnitDefinition x = (s as UnitDefinition).clone(); c = x; }
              else if ( c is ListOfCompartmentTypes ) { ListOfCompartmentTypes x = (s as ListOfCompartmentTypes).clone(); c = x; }
              else if ( c is ListOfCompartments ) { ListOfCompartments x = (s as ListOfCompartments).clone(); c = x; }
              else if ( c is ListOfConstraints ) { ListOfConstraints x = (s as ListOfConstraints).clone(); c = x; }
              else if ( c is ListOfEventAssignments ) { ListOfEventAssignments x = (s as ListOfEventAssignments).clone(); c = x; }
              else if ( c is ListOfEvents ) { ListOfEvents x = (s as ListOfEvents).clone(); c = x; }
              else if ( c is ListOfFunctionDefinitions ) { ListOfFunctionDefinitions x = (s as ListOfFunctionDefinitions).clone(); c = x; }
              else if ( c is ListOfInitialAssignments ) { ListOfInitialAssignments x = (s as ListOfInitialAssignments).clone(); c = x; }
              else if ( c is ListOfParameters ) { ListOfParameters x = (s as ListOfParameters).clone(); c = x; }
              else if ( c is ListOfReactions ) { ListOfReactions x = (s as ListOfReactions).clone(); c = x; }
              else if ( c is ListOfRules ) { ListOfRules x = (s as ListOfRules).clone(); c = x; }
              else if ( c is ListOfSpecies ) { ListOfSpecies x = (s as ListOfSpecies).clone(); c = x; }
              else if ( c is ListOfSpeciesReferences ) { ListOfSpeciesReferences x = (s as ListOfSpeciesReferences).clone(); c = x; }
              else if ( c is ListOfSpeciesTypes ) { ListOfSpeciesTypes x = (s as ListOfSpeciesTypes).clone(); c = x; }
              else if ( c is ListOfUnitDefinitions ) { ListOfUnitDefinitions x = (s as ListOfUnitDefinitions).clone(); c = x; }
              else if ( c is ListOfUnits ) { ListOfUnits x = (s as ListOfUnits).clone(); c = x; }
              else
              {
            ERR("[testClone] Error: (" + ename + ") : clone() failed.");
            return;
              }

              if ( c == null)
              {
            ERR("[testClone] Error: (" + ename + ") : clone() failed.");
            return;
              }

              string enameClone = c.getElementName();

              if ( ename == enameClone )
              {
            //Console.Out.WriteLine("[testClone] OK: (" + ename + ") clone(" + enameClone + ") : type match.");
            OK();
              }
              else
              {
            ERR("[testClone] Error: (" + ename + ") clone(" + enameClone + ") : type mismatch.");
              }
        }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:70,代码来源:TestRW.cs


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