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


C# LoadType.ToString方法代码示例

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


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

示例1: DoLoad

        private void DoLoad(LoadType loadType)
        {
            lock (loadLock)
            {
                instance.timer.Change(Timeout.Infinite, Timeout.Infinite);
                var tran = Cat.NewTransaction("LoadDataSource", loadType.ToString());
                logger.Info("Load data source begin - " + loadType.ToString());

                try
                {
                    if (instance.names == null)
                        instance.names = instance.GetNames();

                    if (instance.names.Length > 0)
                    {
                        var coll = DataSourceProvider.GetProvider().GetConnectionStrings(instance.names);
                        DataSourceManager.AddConnectionStrings(coll);

                        string names = string.Join(",", DataSourceManager.GetAllNames());
                        Cat.LogEvent("LoadDataSource.Cache", "LoadDataSource.Cache.Entries", CatConstants.SUCCESS, names);
                        logger.Info("Data sources cached", names);
                    }

                    tran.Status = CatConstants.SUCCESS;
                }
                catch (Exception ex)
                {
                    var msg = "Error occured during loading data source.";
                    Cat.LogError(msg, ex);
                    tran.SetStatus(ex);
                    logger.Error(msg, ex);

                    if (loadType == LoadType.Initialize)
                        throw;
                }
                finally
                {
                    tran.Complete();
                    logger.Info("Load data source end.");
                    instance.timer.Change(ConfigHelper.UpdateInterval * 1000, Timeout.Infinite);
                }
            }
        }
开发者ID:felix-tien,项目名称:TechLab,代码行数:43,代码来源:DataSourceLoader.cs

示例2: LoadXML

        ///	<summary>
        /// 从文件或者URL加载XML
        /// Easy way to load XML from a file or URL
        /// </summary>
        public bool LoadXML(string sourceXMLOrFile, LoadType loadType, Encoding encoding)
        {
            bool bLoadResult = false;

            try
            {
                switch (loadType)
                {
                    case LoadType.FromString:
                        m_xmlDocument.LoadXml(sourceXMLOrFile); // loading from source XML text
                        break;

                    case LoadType.FromLocalFile:
                        m_xmlDocument.Load(sourceXMLOrFile); // loading from a file
                        break;

                    case LoadType.FromURL:
                        {
                            string sURLContent = GetURLContent(sourceXMLOrFile, encoding);
                            m_xmlDocument.LoadXml(sURLContent);
                            break;
                        }

                    default:
                        string sErr = "Developer note:  No LoadType case supported for " + loadType.ToString();
                        throw (new Exception(sErr));
                }

                DoPostLoadCreateInit();

                bLoadResult = true;
            }
            catch (Exception e)
            {
                HandleException(e);
            }

            return bLoadResult;
        }
开发者ID:CSharpDev,项目名称:Dev.All,代码行数:43,代码来源:XmlHelper.cs

示例3: GetEffectiveLength

        public double GetEffectiveLength(double l_u, double d, LateralBracingCondition BracingConditition,
            SupportCondition Support, LoadType LoadType, int NumberOfLoads = 0)
        {
            double l_e = double.PositiveInfinity;

            //adjust values
            SupportCondition bc = Support;
            LateralBracingCondition br = BracingConditition;
            int N = NumberOfLoads;

            if (bc == SupportCondition.Cantilever)
            {
                br = LateralBracingCondition.Unbraced;
            }
            if (bc == SupportCondition.SingleSpan)
            {
                if (LoadType ==  NDS2015.LoadType.UniformlyDistributed)
                {
                    br = LateralBracingCondition.Unbraced;
                }
                else
                {
                    if (br == LateralBracingCondition.Unbraced && N>2)
                    {
                        N = 2;
                    }
                    else
                    {
                        if (N>7)
                        {
                            N = 7;
                        }
                    }
                }
            }
            //Find value in table

            #region Read Effective Length Data

            var SampleValue = new 
            { BC = "", LoadType = "", Br = "", N=1,
                l_d_Less7_luFactor= 0.0,
                l_d_Less7_dFactor= 0.0, 
                l_d_Less14_luFactor = 0.0, 
                l_d_Less14_dFactor = 0.0,
                l_d_More14_luFactor = 0.0, 
                l_d_More14_dFactor = 0.0 
            }; // sample
            var EffectiveLengthTableVals = ListFactory.MakeList(SampleValue);

            using (StringReader reader = new StringReader(Resources.NDS2015_Table3_3_3EffectiveLength))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    string[] Vals = line.Split(',');
                    if (Vals.Length == 10)
                    {

                        string _BC =        Vals[0];
                        string _LoadType =  Vals[1];
                        string _Br =        Vals[2];
                        int _N =         int.Parse(Vals[3]);
                        double _l_d_Less7_luFactor  =double.Parse(Vals[4]);
                        double _l_d_Less7_dFactor = double.Parse(Vals[5]);
                        double _l_d_Less14_luFactor = double.Parse(Vals[6]);
                        double _l_d_Less14_dFactor = double.Parse(Vals[7]);
                        double _l_d_More14_luFactor = double.Parse(Vals[8]);
                        double _l_d_More14_dFactor  =double.Parse(Vals[9]);

                        EffectiveLengthTableVals.Add
                        (new
                            {
                                BC =        _BC ,        
                                LoadType =  _LoadType ,  
                                Br =        _Br ,
                                N=_N,
                                l_d_Less7_luFactor = _l_d_Less7_luFactor , 
                                l_d_Less7_dFactor  = _l_d_Less7_dFactor  , 
                                l_d_Less14_luFactor= _l_d_Less14_luFactor, 
                                l_d_Less14_dFactor = _l_d_Less14_dFactor , 
                                l_d_More14_luFactor= _l_d_More14_luFactor, 
                                l_d_More14_dFactor = _l_d_More14_dFactor  

                           }

                        );
                    }
                }

            }

            #endregion

            double lu_factor = 0.0;
            double dFactor = 0.0;

            var EffectiveLengthEntryData = EffectiveLengthTableVals.First(l => 
                l.BC==bc.ToString()
                && l.Br == br.ToString()
//.........这里部分代码省略.........
开发者ID:Wosad,项目名称:Wosad.Design,代码行数:101,代码来源:EffectiveLength.cs


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