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


C# Function.ToString方法代码示例

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


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

示例1: GetFunctionName

 internal virtual string GetFunctionName(Function Function)
 {
     switch (Function)
     {
         case Function.Count: return "COUNT";
         default: throw new NotSupportedException($"The given function (`{Function.ToString()}`) is not supporthed in the surrent context.");
     }
 }
开发者ID:DiligentKeyPresser,项目名称:nORM,代码行数:8,代码来源:SQLContext.cs

示例2: Ensure

        private void Ensure(Function Action, string Name, string Area)
        {
            using (new FunctionLogger(Log))
            {
                var ActionName = Action.ToString();

                Log.InfoFormat("Action: {0}", ActionName);
                Log.InfoFormat("Name: {0}", Name);
                Log.InfoFormat("Area: {0}", Area);

                var ActivityService = ServiceFactory.CreateService<IActivityService>();

                if (ActivityService.Get(ActionName, Name, Area) == null)
                {
                    Log.InfoFormat("Adding activity: {0}, {1}, {2}", Name, Area, ActionName);
                    ActivityService.Save(new Dtos.Activity { Name = Name, Area = Area, Action = ActionName });
                }
            }
        }
开发者ID:skankydog,项目名称:fido,代码行数:19,代码来源:Boot.cs

示例3: WriteWrapper

        int WriteWrapper(BindStreamWriter sw, int current, Function f, EnumCollection enums)
        {
            if ((Settings.Compatibility & Settings.Legacy.NoDocumentation) == 0)
            {
                string text = String.Format("Writing function #{0}: {1}", current++, f.ToString());
                ConsoleRewrite(text);

                WriteDocumentation(sw, f);
            }
            WriteMethod(sw, f, enums);
            sw.WriteLine();
            return current;
        }
开发者ID:BrainSlugs83,项目名称:opentk,代码行数:13,代码来源:CSharpSpecWriter.cs

示例4: Write

 public void Write(Function f)
 {
     foreach (string s in splitLines.Split(f.ToString()))
         WriteLine(s);
 }
开发者ID:ronsaldo,项目名称:chela,代码行数:5,代码来源:BindStreamWriter.cs

示例5: PerformanceTest

        public static void PerformanceTest(Function function)
        {
            Console.WriteLine("*****" + function.ToString().ToUpper() + "*****");

            float resultFloat = FloatValue;
            StopWatch.Start();

            for (int i = 0; i < OperationsCount; i++)
            {
                switch (function)
                {
                    case Function.Sqrt:
                        resultFloat = (float)Math.Sqrt(FloatValue);
                        break;
                    case Function.Log:
                        resultFloat = (float)Math.Log(FloatValue);
                        break;
                    case Function.Sin:
                        resultFloat = (float)Math.Sin(FloatValue);
                        break;
                    default:
                        throw new InvalidOperationException("Invalid function!");
                }
            }

            StopWatch.Stop();
            Console.WriteLine("{0,-15}:{1}", "Float", StopWatch.Elapsed);
            StopWatch.Reset();

            double resultDouble = DoubleValue;
            StopWatch.Start();

            for (int i = 0; i < OperationsCount; i++)
            {
                switch (function)
                {
                    case Function.Sqrt:
                        resultDouble = (double)Math.Sqrt(DoubleValue);
                        break;
                    case Function.Log:
                        resultDouble = (double)Math.Log(DoubleValue);
                        break;
                    case Function.Sin:
                        resultDouble = (double)Math.Sin(DoubleValue);
                        break;
                    default:
                        throw new InvalidOperationException("Invalid function!");
                }
            }

            StopWatch.Stop();
            Console.WriteLine("{0,-15}:{1}", "Double", StopWatch.Elapsed);
            StopWatch.Reset();

            decimal resultDecimle = DecimalValue;
            StopWatch.Start();

            for (int i = 0; i < OperationsCount; i++)
            {
                switch (function)
                {
                    case Function.Sqrt:
                        resultDecimle = (decimal)Math.Sqrt((double)DecimalValue);
                        break;
                    case Function.Log:
                        resultDecimle = (decimal)Math.Log((double)DecimalValue);
                        break;
                    case Function.Sin:
                        resultDecimle = (decimal)Math.Sin((double)DecimalValue);
                        break;
                    default:
                        throw new InvalidOperationException("Invalid function!");
                }
            }

            StopWatch.Stop();
            Console.WriteLine("{0,-15}:{1}", "Decimal", StopWatch.Elapsed);
            StopWatch.Reset();
        }
开发者ID:ivanvasilev,项目名称:Telerik-Academy-Homeworks,代码行数:79,代码来源:MathFunctionsTester.cs


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