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


C# Product.setName方法代码示例

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


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

示例1: getProductsFromBiobricks

    public LinkedList<Product> getProductsFromBiobricks(LinkedList<BioBrick> list)
    {
        LinkedList<Product> products = new LinkedList<Product>();
        Product prod;
        RBSBrick rbs;
        GeneBrick gene;
        float RBSf = 0f;
        string molName = "Unknown";
        int i = 0;

        foreach (BioBrick b in list)
          {
        rbs = b as RBSBrick;
        if (rbs != null)
          RBSf = rbs.getRBSFactor();
        else
          {
            gene = b as GeneBrick;
            if (gene != null)
              {
                molName = gene.getProteinName();
                prod = new Product();
                prod.setName(molName);
                prod.setQuantityFactor(RBSf);
                products.AddLast(prod);
              }
            else
              Debug.Log("This case should never arrive. Bad Biobrick in operon.");
          }
        i++;
          }
        while (i > 0)
          list.RemoveFirst();
        return products;
    }
开发者ID:quito,项目名称:DSynBio_reloaded,代码行数:35,代码来源:Device.cs

示例2: loadGene

    private bool loadGene(Promoter prom, string name, string RBSf)
    {
        Product gene = new Product();

        if (String.IsNullOrEmpty(name) || String.IsNullOrEmpty(RBSf))
          {
        Debug.Log("Error: Empty Gene name field");
        return false;
          }
        gene.setName(name);
        gene.setQuantityFactor(float.Parse(RBSf.Replace(",", ".")));
        prom.addProduct(gene);
        return true;
    }
开发者ID:CyberCRI,项目名称:DsynBio,代码行数:14,代码来源:PromoterLoader.cs

示例3: loadInstantReactionReactant

 private bool loadInstantReactionReactant(XmlNode node, InstantReaction ir)
 {
     Product prod = new Product();
     foreach (XmlNode attr in node)
       {
     if (attr.Name == "name")
       {
         if (String.IsNullOrEmpty(attr.InnerText))
           Debug.Log("Warning : Empty name field in instant reaction reactant definition");
         prod.setName(attr.InnerText);
       }
     else if (attr.Name == "quantity")
       {
         if (String.IsNullOrEmpty(attr.InnerText))
           Debug.Log("Warning : Empty quantity field in instant reaction reactant definition");
         prod.setQuantityFactor(float.Parse(attr.InnerText.Replace(",", ".")));
       }
       }
     ir.addReactant(prod);
     return true;
 }
开发者ID:CyberCRI,项目名称:DsynBio,代码行数:21,代码来源:InstantReactionLoader.cs

示例4: always

 /*!
 \brief This function load all the products wich are in <Products> fields and store them in an ActiveTransportProprieties.
 \param node The XmlNode corresponding to <Products> </Products>.
 \param AT The ActiveTransportProprieties where to store the products
 \return Return true always (not really usefull)
    */
 private bool loadActiveTransportReactionProducts(XmlNode node, ActiveTransportProprieties AT)
 {
     AT.products = new LinkedList<Product>();
     foreach (XmlNode attr in node)
       {
     if (attr.Name == "name")
       {
         if (String.IsNullOrEmpty(attr.InnerText))
           Debug.Log("Warning : Empty name field in ActiveTransport Reaction definition");
         Product prod = new Product();
         prod.setName(node.InnerText);
         AT.products.AddLast(prod);
       }
       }
     return true;
 }
开发者ID:CyberCRI,项目名称:DsynBio,代码行数:22,代码来源:ActiveTransportLoader.cs

示例5: loadEnzymeReactionProducts

 private bool loadEnzymeReactionProducts(XmlNode node, EnzymeReaction er)
 {
     foreach (XmlNode attr in node)
       {
     if (attr.Name == "name")
       {
         if (String.IsNullOrEmpty(attr.InnerText))
           Debug.Log("Warning : Empty name field in Enzyme Reaction definition");
         Product prod = new Product();
         prod.setName(node.InnerText);
         er.addProduct(prod);
       }
       }
     return true;
 }
开发者ID:CyberCRI,项目名称:DsynBio,代码行数:15,代码来源:EnzymeReactionLoader.cs

示例6: getProductsFromBiobricks

  private LinkedList<Product> getProductsFromBiobricks(LinkedList<BioBrick> list)
  {
    Logger.Log("Device::getProductsFromBioBricks([list: "+Logger.ToString(list)+"])", Logger.Level.DEBUG);
    LinkedList<Product> products = new LinkedList<Product>();
    Product prod;
    RBSBrick rbs;
    GeneBrick gene;
    float RBSf = 0f;
    string molName = "Unknown";
    int i = 0;

    foreach (BioBrick b in list)
      {
        Logger.Log("Device::getProductsFromBioBricks: starting treatment of "+b.ToString(), Logger.Level.TRACE);
        rbs = b as RBSBrick;
        if (rbs != null) {
          Logger.Log("Device::getProductsFromBioBricks: rbs spotted", Logger.Level.TRACE);
          RBSf = rbs.getRBSFactor();
      }
        else
          {
            Logger.Log("Device::getProductsFromBioBricks: not an rbs", Logger.Level.TRACE);
            gene = b as GeneBrick;
            if (gene != null)
              {
                molName = gene.getProteinName();
                prod = new Product();
                prod.setName(molName);
                prod.setQuantityFactor(RBSf);
                products.AddLast(prod);
              }
            else
              {
                if (b as TerminatorBrick == null)
                  Logger.Log("Device::getProductsFromBioBricks This case should never happen. Bad Biobrick in operon.", Logger.Level.WARN);
                else {
                 break;
                }
              }
          }
        i++;
      }
    while (i > 0) {
      list.RemoveFirst();
      i--;
    }
    return products;
  }
开发者ID:CyberCRI,项目名称:Hero.Coli,代码行数:48,代码来源:Device.cs

示例7: always

 /*!
 \brief This function load all the products which are in <Products> fields and store them in an ActiveTransportProperties.
 \param node The XmlNode corresponding to <Products> </Products>.
 \param AT The ActiveTransportProperties where to store the products
 \return Return true always (not really usefull)
 */
 private bool loadActiveTransportReactionProducts(XmlNode node)
 {
   products = new LinkedList<Product>();
   foreach (XmlNode attr in node)
   {
     if (attr.Name == "name")
     {
       if (String.IsNullOrEmpty(attr.InnerText))
         Debug.Log("Warning : Empty name field in ActiveTransport Reaction definition");
       Product prod = new Product();
       prod.setName(node.InnerText);
       products.AddLast(prod);
     }
   }
   if(0 == products.Count)
   {
     Logger.Log("ActiveTransport.loadActiveTransportReactionProducts no product loaded"
                , Logger.Level.ERROR);
     return false;
   }
   else
   {
     return true;
   }
 }
开发者ID:CyberCRI,项目名称:Hero.Coli,代码行数:31,代码来源:ActiveTransportProperties.cs

示例8: loadEnzymeReactionProducts

  /*!
  \brief Load products of an enzymatic reaction
  \param node The xml node to load
  \return Return always true
 */
  private bool loadEnzymeReactionProducts(XmlNode node)
  {
    foreach (XmlNode attr in node)
    {
      if (attr.Name == "name")
      {
        if (String.IsNullOrEmpty(attr.InnerText))
        {
          Logger.Log("EnzymeReaction::loadEnzymeReactionProducts : Empty name field in Enzyme Reaction definition"
                             , Logger.Level.ERROR);
          return false;
        }
        Product prod = new Product();
        prod.setName(node.InnerText);
        addProduct(prod);
      }
    }
    return true;
  }
开发者ID:CyberCRI,项目名称:Hero.Coli,代码行数:24,代码来源:EnzymeReaction.cs

示例9: loadInstantReactionProduct

   /*!
   \brief Parse and load products of an InstantReaction
   \param node The xml node to parse
   \return return always true
 */
   private bool loadInstantReactionProduct(XmlNode node)
   {
     Product prod = new Product();
     foreach (XmlNode attr in node)
     {
       if (attr.Name == "name")
       {
         if (String.IsNullOrEmpty(attr.InnerText))
         {
           Logger.Log("InstantReaction::loadInstantReactionProduct Empty name field in instant reaction product definition"
                              , Logger.Level.ERROR);
           return false;
         }
         prod.setName(attr.InnerText);
       }
       else if (attr.Name == "quantity")
       {
         if (String.IsNullOrEmpty(attr.InnerText))
         {
           Logger.Log("InstantReaction::loadInstantReactionProduct Empty quantity field in instant reaction product definition"
                        , Logger.Level.ERROR);
           return false;
         }
         prod.setQuantityFactor(float.Parse(attr.InnerText.Replace(",", ".")));
       }
     }
     addProduct(prod);
     return true;
   }
开发者ID:CyberCRI,项目名称:Hero.Coli,代码行数:34,代码来源:InstantReaction.cs


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