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


C# Module.getService方法代码示例

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


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

示例1: checkConsistency

        public static int checkConsistency()
        {
            try
            {
                var oArguments = new DataBlockWriter();

                LowLevel.SBWConnect();
                var oModule = new Module("edu.caltech.NOMClipboard");
                Service oService = oModule.getService("NOM");
                return
                    (int)
                    HighLevel.convertArray(oService.getMethod("int checkConsistency()").call(oArguments).getObject());
            }
            catch (SBWException e)
            {
                throw e;
            }
        }
开发者ID:hsauro,项目名称:auto-sbml,代码行数:18,代码来源:SBMLSupport.cs

示例2: convertLevel1ToLevel2Impl

        public static string convertLevel1ToLevel2Impl(string var0)
        {
            try
            {
                var oArguments = new DataBlockWriter();
                oArguments.add(var0);

                LowLevel.SBWConnect();
                var oModule = new Module("edu.caltech.NOMClipboard");
                Service oService = oModule.getService("NOM");
                return
                    (string)
                    HighLevel.convertArray(
                        oService.getMethod("string convertLevel1ToLevel2Impl(string)").call(oArguments).getObject());
            }
            catch (SBWException e)
            {
                throw e;
            }
        }
开发者ID:hsauro,项目名称:auto-sbml,代码行数:20,代码来源:SBMLSupport.cs

示例3: oItem_Click

 private void oItem_Click(object sender, EventArgs e)
 {
     try
     {
         if ((SBML == null) || SBML == "")
         {
             MessageBox.Show("There is no model to analyze. Load a model first.", "No Model loaded",
                             MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         var oTemp = (SBWAnalyzer) oAnalyzers[((MenuItem) sender).Text];
         var oModule = new Module(oTemp.ModuleName);
         Service oService = oModule.getService(oTemp.ServiceName);
         oService.getMethod("void doAnalysis(string)").Send(SBML);
     }
     catch (SBWException ex)
     {
         MessageBox.Show(
             String.Format("An error while calling the Analyzer.{0}{0}{0}({1}{0}{1})", Environment.NewLine,
                           ex.Message, ex.DetailedMessage),
             "Error calling the Analyzer", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception)
     {
     }
 }
开发者ID:hsauro,项目名称:auto-sbml,代码行数:26,代码来源:MainForm.cs

示例4: updateSBWMenu

        private void updateSBWMenu()
        {
            if (!IsSBWAvailable)
                return;
            try
            {
                bool bWasConnected = LowLevel.SBWGetConnectionStatus();
                if (!bWasConnected)
                    LowLevel.SBWConnect();

                oSBWMenu.MenuItems.Clear();
                oAnalyzers = new Hashtable();
                var oBroker = new Module("BROKER");
                Service oService = oBroker.getService("BROKER");
                Method oMethod = oService.getMethod("{}[] findServices(string,boolean)");
                ArrayList[] oList = oMethod.Call("/Analysis", true).get1DListArray();

                var oModules = new SortedList(CaseInsensitiveComparer.Default);

                foreach (ArrayList list in oList)
                {
                    try
                    {
                        var uniqueName = (string) list[2];
                        if (oModules.Contains(uniqueName))
                            uniqueName += String.Format(" ({0})", list[0]);
                        oModules.Add(uniqueName, list);
                    }
                    catch (Exception)
                    {
                    }
                }

                foreach (DictionaryEntry entry in oModules)
                {
                    var sKey = (string) entry.Key;
                    var list = (ArrayList) entry.Value;
                    if ("AutoCSharp" != (string) list[0])
                    {
                        var uniqueName = (string) list[2];
                        if (oAnalyzers.Contains(uniqueName))
                            uniqueName += " (" + list[0] + ")";
                        var oItem = new MenuItem(uniqueName);

                        oAnalyzers.Add(uniqueName, new SBWAnalyzer((string) list[0], (string) list[1]));

                        oItem.Click += oItem_Click;
                        oSBWMenu.MenuItems.Add(oItem);
                    }
                }

                if (!bWasConnected)
                    LowLevel.SBWDisconnect();
            }
            catch (Exception)
            {
            }

            if (oAnalyzers.Count == 0)
            {
                IsSBWAvailable = false;
                oSBWMenu.Visible = false;
            }
        }
开发者ID:hsauro,项目名称:auto-sbml,代码行数:64,代码来源:MainForm.cs

示例5: oItem_Click

 private void oItem_Click(object sender, EventArgs e)
 {
     try
     {
         var oTemp = (SBWAnalyzer) oAnalyzers[((MenuItem) sender).Text];
         var oModule = new Module(oTemp.ModuleName);
         Service oService = oModule.getService(oTemp.ServiceName);
         oService.getMethod("void doAnalysis(string)").Send(Util.GetSBMLForParameter(_CurrentParameter));
     }
     catch (SBWException ex)
     {
         MessageBox.Show(
             String.Format("An error while calling the Analyzer.{0}{0}{0}({1}{0}{1})", Environment.NewLine,
                           ex.Message, ex.DetailedMessage),
             "Error calling the Analyzer", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception)
     {
     }
 }
开发者ID:hsauro,项目名称:auto-sbml,代码行数:20,代码来源:GraphControl.cs

示例6: getNthListOfModifiers

        public static ArrayList getNthListOfModifiers(int var0)
        {
            try
            {
                var oArguments = new DataBlockWriter();
                oArguments.add(var0);

                LowLevel.SBWConnect();
                var oModule = new Module("edu.caltech.NOMClipboard");
                Service oService = oModule.getService("NOM");
                return
                    (ArrayList)
                    HighLevel.convertArray(
                        oService.getMethod("{} getNthListOfModifiers(int)").call(oArguments).getObject());
            }
            catch (SBWException e)
            {
                throw e;
            }
        }
开发者ID:hsauro,项目名称:auto-sbml,代码行数:20,代码来源:SBMLSupport.cs

示例7: setValue

        public static void setValue(string var0, double var1)
        {
            try
            {
                var oArguments = new DataBlockWriter();
                oArguments.add(var0);
                oArguments.add(var1);

                LowLevel.SBWConnect();
                var oModule = new Module("edu.caltech.NOMClipboard");
                Service oService = oModule.getService("NOM");
                oService.getMethod("void setValue(string,double)").call(oArguments);
                return;
            }
            catch (SBWException e)
            {
                throw e;
            }
        }
开发者ID:hsauro,项目名称:auto-sbml,代码行数:19,代码来源:SBMLSupport.cs

示例8: isReactionReversible

        public static bool isReactionReversible(int var0)
        {
            try
            {
                var oArguments = new DataBlockWriter();
                oArguments.add(var0);

                LowLevel.SBWConnect();
                var oModule = new Module("edu.caltech.NOMClipboard");
                Service oService = oModule.getService("NOM");
                return
                    (bool)
                    HighLevel.convertArray(
                        oService.getMethod("boolean isReactionReversible(int)").call(oArguments).getObject());
            }
            catch (SBWException e)
            {
                throw e;
            }
        }
开发者ID:hsauro,项目名称:auto-sbml,代码行数:20,代码来源:SBMLSupport.cs

示例9: getNthReactantStoichiometryDouble

        public static double getNthReactantStoichiometryDouble(int var0, int var1)
        {
            try
            {
                var oArguments = new DataBlockWriter();
                oArguments.add(var0);
                oArguments.add(var1);

                LowLevel.SBWConnect();
                var oModule = new Module("edu.caltech.NOMClipboard");
                Service oService = oModule.getService("NOM");
                return
                    (double)
                    HighLevel.convertArray(
                        oService.getMethod("double getNthReactantStoichiometryDouble(int,int)")
                                .call(oArguments)
                                .getObject());
            }
            catch (SBWException e)
            {
                throw e;
            }
        }
开发者ID:hsauro,项目名称:auto-sbml,代码行数:23,代码来源:SBMLSupport.cs


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