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


C# Common.ToString方法代码示例

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


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

示例1: GetFrequencyTypeID

 public static int GetFrequencyTypeID(Common.Api.ExigoWebService.FrequencyType FrequencyType)
 {
     try
     {
         return FrequencyTypeBindings.Where(c => c.Key == FrequencyType).FirstOrDefault().Value;
     }
     catch
     {
         throw new Exception("Corresponding int not found for FrequencyType {0}.".FormatWith(FrequencyType.ToString()));
     }
 }
开发者ID:winmissupport,项目名称:FeatureUpate,代码行数:11,代码来源:FrequencyTypes.cs

示例2: ConvertLogLevel

 public static Level ConvertLogLevel(Common.Logging.LogLevel logLevel)
 {
     switch (logLevel)
     {
         case Common.Logging.LogLevel.All:
             return Level.All;
         case Common.Logging.LogLevel.Debug:
             return Level.Debug;
         case Common.Logging.LogLevel.Error:
             return Level.Error;
         case Common.Logging.LogLevel.Fatal:
             return Level.Fatal;
         case Common.Logging.LogLevel.Info:
             return Level.Info;
         case Common.Logging.LogLevel.Off:
             return Level.Off;
         case Common.Logging.LogLevel.Trace:
             return Level.Trace;
         case Common.Logging.LogLevel.Warn:
             return Level.Warn;
         default:
             throw new NotSupportedException("Not Supported logLevel:" + logLevel.ToString());
     }
 }
开发者ID:yonglehou,项目名称:ImcTF,代码行数:24,代码来源:FileAppenderHelper.cs

示例3: Events_OnNotificationSent

 static void Events_OnNotificationSent(Common.Notification notification)
 {
     Console.WriteLine("Sent: " + notification.Platform.ToString() + " -> " + notification.ToString());
 }
开发者ID:ngoossens,项目名称:PushSharp,代码行数:4,代码来源:Program.cs

示例4: Events_OnNotificationSendFailure

 static void Events_OnNotificationSendFailure(Common.Notification notification, Exception notificationFailureException)
 {
     Console.WriteLine("Failure: " + notification.Platform.ToString() + " -> " + notificationFailureException.Message + " -> " + notification.ToString());
 }
开发者ID:ngoossens,项目名称:PushSharp,代码行数:4,代码来源:Program.cs

示例5: Events_OnDeviceSubscriptionExpired

 static void Events_OnDeviceSubscriptionExpired(Common.PlatformType platform, string deviceInfo, Common.Notification notification)
 {
     Console.WriteLine("Device Subscription Expired: " + platform.ToString() + " -> " + deviceInfo);
 }
开发者ID:ngoossens,项目名称:PushSharp,代码行数:4,代码来源:Program.cs

示例6: Events_OnChannelException

 static void Events_OnChannelException(Exception exception, Common.PlatformType platformType, Common.Notification notification)
 {
     Console.WriteLine("Channel Exception: " + platformType.ToString() + " -> " + exception.ToString());
 }
开发者ID:ngoossens,项目名称:PushSharp,代码行数:4,代码来源:Program.cs

示例7: Events_OnChannelDestroyed

 static void Events_OnChannelDestroyed(Common.PlatformType platformType, int newChannelCount)
 {
     Console.WriteLine("Channel Destroyed for: " + platformType.ToString() + " Channel Count: " + newChannelCount);
 }
开发者ID:ngoossens,项目名称:PushSharp,代码行数:4,代码来源:Program.cs

示例8: GenerateQueryString

 public static string GenerateQueryString(int id, StringBuilder xmlData, Common.ApiMethods apiMethod)
 {
     var method = apiMethod.ToString().ToLower();
     var queryString = Uri.EscapeUriString(apiMethod != Common.ApiMethods.Delete ?
                                             $"http://myanimelist.net/api/animelist/{method}/{id}.xml?data={xmlData}"
                                             : $"http://myanimelist.net/api/animelist/{method}/{id}.xml");
     return queryString;
 }
开发者ID:lolerji,项目名称:dozzmai-mal-api,代码行数:8,代码来源:ManagerUtility.cs

示例9: InsertAudience

 private Audience InsertAudience(Common.Grade grade)
 {
     Audience newAutdience = DataWorkspace.ApplicationData.Audiences.AddNew();
     newAutdience.Title = grade.ToString();
     return newAutdience;
 }
开发者ID:natovichat,项目名称:binyamin,代码行数:6,代码来源:SearchActivityViews.cs

示例10: Command

        public Command(Common.SharedCommandName commandName, params string[] options): this(commandName.ToString(), options)
        {

        }
开发者ID:HatipMevis,项目名称:TS3QueryLib.Net,代码行数:4,代码来源:Command.cs

示例11: GetShiftProjectProdQtySummariesByProcess

        /// <summary>
        /// 獲取指定工序的班次內工程產量統計記錄列表
        /// </summary>
        /// <param name="processType">工序類型</param>
        /// <returns></returns>
        public List<ShiftProjectProdQtySummary_Query> GetShiftProjectProdQtySummariesByProcess(Common.CustEnum.ProdProcess processType)
        {
            List<ShiftProjectProdQtySummary_Query> listSummary = new List<ShiftProjectProdQtySummary_Query>();

            try
            {
                string strSQLConn = DbHelperSQL.GetProcessSQLConnString(processType);

                if (!string.IsNullOrEmpty(strSQLConn))
                {
                    string strSourceFrom = string.Empty;
                    switch (processType)
                    {
                        case Common.CustEnum.ProdProcess.LAM:
                            strSourceFrom = "過膠";
                            break;
                        case Common.CustEnum.ProdProcess.HOT:
                            strSourceFrom = "燙金";
                            break;
                        case Common.CustEnum.ProdProcess.SILK:
                            strSourceFrom = "絲印";
                            break;
                        default:
                            break;
                    }

                    StringBuilder strSQL = new StringBuilder();
                    strSQL.AppendLine("declare @dProDate datetime set @dProDate=convert(char(10),getdate(),120) --查詢日期");
                    strSQL.AppendLine("select right(amr_cAreaName,2) as ProcessName--[工序]");
                    strSQL.AppendLine(",amr_cAreaLocation as MachineLocation--[機台位置]");
                    strSQL.AppendLine(",mmt_cMachineID as MachineNo--[機台編號]");
                    strSQL.AppendLine(",cmt2.cmt_cRemark as MachineType--[機種]");
                    strSQL.AppendLine(",isnull(mpi.ProdDate,'') as ShiftProjectDate--[班次內日期]");
                    strSQL.AppendLine(",isnull(mpi.Projects,'') as LabelQty--[版數]");
                    strSQL.AppendLine(",isnull(mpi.Qty,'') as ProductionQty--[產量] ");
                    strSQL.AppendLine("from MachineMaster_mmt with(nolock)");
                    strSQL.AppendLine("left join (select CONVERT(CHAR(10),sifo_dProdDate,120) as ProdDate");
                    strSQL.AppendLine(",ppj_cMachineNO as MachineNO,COUNT(ppj_cMachineNO) AS Projects,SUM(spl_iQTY) as Qty");
                    strSQL.AppendLine("from ShiftProjList_spl with(nolock)");
                    strSQL.AppendLine("left join PrintProject_ppj with(nolock) on spl_PPJID=ppj_RecordID");
                    strSQL.AppendLine("left join ShiftInfo_sifo with(nolock) on spl_SIFOID=sifo_RecordID");
                    strSQL.AppendLine("where 1=1 ");
                    strSQL.AppendLine("/*搜索條件*/");
                    strSQL.AppendLine("and [email protected]");
                    strSQL.AppendLine("group by sifo_dProdDate,ppj_cMachineNO");
                    strSQL.AppendLine("/*搜索條件*/");
                    strSQL.AppendLine(") mpi on mpi.MachineNO=mmt_cMachineID");
                    strSQL.AppendLine("left join AreaMaster_amr With(Nolock) on mmt_cAreaID=amr_cRecordID ");
                    strSQL.AppendLine("left join CodeMaster_cmt cmt2 With(Nolock) on mmt_cMachineType=cmt2.cmt_cValue ");
                    strSQL.AppendLine("and cmt2.cmt_cKey1='TYPEVALUE' and cmt2.cmt_cKey2='MACHINETYPE'");
                    strSQL.AppendLine("where mmt_iIsPublic=0 and mmt_lActive=1");
                    strSQL.AppendLine("order by  MachineLocation,MachineNo--[機台位置],[機台編號]");

                    using (SqlDataReader reader = DbHelperSQL.ExecuteReader(strSQLConn, strSQL.ToString()))
                    {
                        while (reader.Read())
                        {
                            ShiftProjectProdQtySummary_Query model = new ShiftProjectProdQtySummary_Query();
                            model.SourceFrom = strSourceFrom;

                            if (reader["ProcessName"] != null && reader["ProcessName"].ToString() != string.Empty)
                            {
                                model.ProcessName = reader["ProcessName"].ToString();
                            }
                            if (reader["MachineLocation"] != null && reader["MachineLocation"].ToString() != string.Empty)
                            {
                                model.MachineLocation = reader["MachineLocation"].ToString();
                            }
                            if (reader["MachineNo"] != null && reader["MachineNo"].ToString() != string.Empty)
                            {
                                model.MachineNo = reader["MachineNo"].ToString();
                            }
                            if (reader["MachineType"] != null && reader["MachineType"].ToString() != string.Empty)
                            {
                                model.MachineType = reader["MachineType"].ToString();
                            }
                            if (reader["ShiftProjectDate"] != null && reader["ShiftProjectDate"].ToString() != string.Empty)
                            {
                                model.ShiftProjectDate = reader["ShiftProjectDate"].ToString();
                            }
                            if (reader["LabelQty"] != null && reader["LabelQty"].ToString() != string.Empty)
                            {
                                model.LabelQty = int.Parse(reader["LabelQty"].ToString());
                            }
                            if (reader["ProductionQty"] != null && reader["ProductionQty"].ToString() != string.Empty)
                            {
                                model.ProductionQty = int.Parse(reader["ProductionQty"].ToString());
                            }

                            listSummary.Add(model);
                        }
                    }
                }
                else
                {
//.........这里部分代码省略.........
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:101,代码来源:CustomerDataPresentationQueryDAL.cs

示例12: WriteInternal

        protected override void WriteInternal(Common.Logging.LogLevel level, object message, Exception exception)
        {
            Guard.AgainstNullArgument("message", message);

            var consoleLog = false;
            switch (level)
            {
                case Common.Logging.LogLevel.Fatal:
                    consoleLog = true;
                    if (_log.IsFatalEnabled)
                    {
                        _log.Fatal(message, exception);
                    }

                    break;
                case Common.Logging.LogLevel.Error:
                    consoleLog = true;
                    if (_log.IsErrorEnabled)
                    {
                        _log.Error(message, exception);
                    }

                    break;
                case Common.Logging.LogLevel.Warn:
                    consoleLog = true;
                    if (_log.IsWarnEnabled)
                    {
                        _log.Warn(message, exception);
                    }

                    break;
                case Common.Logging.LogLevel.Info:
                    consoleLog = _consoleLogLevel != LogLevel.Error;
                    if (_log.IsInfoEnabled)
                    {
                        _log.Info(message, exception);
                    }

                    break;
                case Common.Logging.LogLevel.Debug:
                    consoleLog = _consoleLogLevel == LogLevel.Debug || _consoleLogLevel == LogLevel.Trace;
                    if (_log.IsDebugEnabled)
                    {
                        _log.Debug(message, exception);
                    }

                    break;
                case Common.Logging.LogLevel.Trace:
                    consoleLog = _consoleLogLevel == LogLevel.Trace;
                    if (_log.IsTraceEnabled)
                    {
                        _log.Trace(message, exception);
                    }

                    break;
            }

            if (consoleLog)
            {
                var prefix = level == Common.Logging.LogLevel.Info
                    ? null
                    : string.Concat(level.ToString().ToUpperInvariant(), ": ");

                ConsoleColor color;
                if (!colors.TryGetValue(level, out color))
                {
                    color = ConsoleColor.White;
                }

                var originalColor = _console.ForegroundColor;
                _console.ForegroundColor = color;
                try
                {
                    _console.WriteLine(string.Concat(prefix, message.ToString()));
                }
                finally
                {
                    _console.ForegroundColor = originalColor;
                }
            }
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:81,代码来源:ScriptConsoleLogger.cs

示例13: makeNode

 internal TreeNode makeNode(Common common)
 {
     var label = common.ToString();
       var n = 100;
       if(label.Length > n)
     label = label.Substring(0,n) + "...";
       TreeNode cNode = new TreeNode(label);
       cNode.Tag = common;
       cNode.ToolTipText = ToolTipProcessor(common.ToolTip());
       if (common.ForeColor() != 0)
     cNode.ForeColor = System.Drawing.Color.FromArgb(common.ForeColor());
       if (common.HasChildren())
     cNode.Nodes.Add(new TreeNode("dummy node"));
       if (common.AutoExpand())
     cNode.Expand();
       return cNode;
 }
开发者ID:edgar-pek,项目名称:VCDryad,代码行数:17,代码来源:Z3AxiomProfiler.cs

示例14: AddMessageToGrid

        private void AddMessageToGrid(string message, Common.ImporterMessageType messageType, bool force = false)
        {
            string[] row = new[] { messageType.ToString(), message };

            if (row.Length == 0)
            {
                return;
            }

            ListViewItem lvi = new ListViewItem(row);
            listView.Items.Insert(0, lvi);
        }
开发者ID:barrett2474,项目名称:CMS2,代码行数:12,代码来源:DocumentUploader.cs

示例15: AbilityFail

 public void AbilityFail(Common.CombatMessage.AbilityError error)
 {
     lastAbilityError = error;
     lua.Error(error.ToString());
 }
开发者ID:Keldyn,项目名称:BattleOfTheClans,代码行数:5,代码来源:LuaAPI.cs


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