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


C# Enums.ToString方法代码示例

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


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

示例1: Button

 public static MvcHtmlString Button(string caption, Enums.ButtonStyle style, Enums.ButtonSize size)
 {
     if (size != Enums.ButtonSize.Normal)
     {
         return new MvcHtmlString(string.Format("<button type=\"button\" class=\"btn btn-{0} btn-{1}\">{2}</button>", style.ToString().ToLower(), ToBootstrapSize(size), caption));
     }
     return new MvcHtmlString(string.Format("<button type=\"button\" class=\"btn btn-{0}\">{1}</button>", style.ToString().ToLower(), caption));
 }
开发者ID:Defcoq,项目名称:YogamHealth,代码行数:8,代码来源:ButtonHelper.cs

示例2: getLocalizationTextFromKey

 public static string getLocalizationTextFromKey(string key, Enums.Language locLanguage)
 {
     string locText = "";
     if (_localizationData.keys.IndexOf (key) == -1)
     {
         return key;
     }
     else
     {
         JSONObject obj = _localizationData.list[_localizationData.keys.IndexOf(key)];
         if(obj[locLanguage.ToString ()]) { locText = obj[locLanguage.ToString()].ToString (); }
         else {locText = key; }
         return locText;
     }
 }
开发者ID:coconutinteractive,项目名称:shakedown,代码行数:15,代码来源:Manager_StaticData.cs

示例3: CheckPrivilege

 public static bool CheckPrivilege(Page page, Enums.ModuleKey moduleKey, Enums.Privilege enPriv)//,object privilegeTable
 {
     DataTable dt = page.Session["AdminFunction"] as DataTable;
     try
     {
         //if ((page.Session["Users"] as NT.Entities.User).IsSuperManager == "yes")//如果是超级管理员
         //    return true;
     }
     catch
     {
         page.Response.Write("<script>parent.location='" + page.ResolveUrl("~/Admin/Login.aspx") + "'</script>");
         return false;
     }
     if (dt.Rows.Count == 0)
     {
         page.Response.Redirect("~/Admin/NoRights.aspx");
         return false;
     }
     DataRow[] rows = dt.Select(string.Format("ModuleKey='{0}' and PrivilegeId={1}",moduleKey.ToString(),(int)enPriv));
     if (rows != null && rows.Length > 0)
     {
         return true;
     }
     else
     {
         page.Response.Redirect("~/Admin/NoRights.aspx");
         return false;
     }
 }
开发者ID:lakeli,项目名称:shizong,代码行数:29,代码来源:PrivilegeService.cs

示例4: IsHavePrivilege

 public static bool IsHavePrivilege(long userId, Enums.ModuleKey moduleKey, Enums.Privilege enPriv)
 {
     DataSet ds = SqlHelper.ExecuteDataSet(CommandType.StoredProcedure, "sp_CheckPrivilege", new SqlParameter[] {
         new SqlParameter("@CustomerId", userId),
      new SqlParameter("@ModuleKey", moduleKey.ToString()),
      new SqlParameter("@PrivilegeId", (int)enPriv)});
     if (ds != null && ds.Tables.Count > 0)
     {
         return ConvertTool.ToBool(ds.Tables[0].Rows[0][0]);
     }       
     return false;
 }
开发者ID:lakeli,项目名称:shizong,代码行数:12,代码来源:PrivilegeService.cs

示例5: BootstrapButton

 public static MvcHtmlString BootstrapButton(this HtmlHelper helper, string caption, Enums.ButtonType type,
     Enums.ButtonStyle style, Enums.ButtonSize size)
 {
     var format = "";
     if (type == Enums.ButtonType.Button)
     {
         format = "<button type=\"button\" class=\"btn btn-{0} {1}\">{2}</button>";
     }
     else if (type == Enums.ButtonType.Submit)
     {
         format = "<input type=\"submit\" class=\"btn btn-{0} {1}\" value=\"{2}\"/>";
     }
     return new MvcHtmlString(string.Format(format, style.ToString().ToLower(), ToBootstrapSize(size), caption));
 }
开发者ID:gunnarsireus,项目名称:SireusMvc5,代码行数:14,代码来源:BootstrapButtons.cs

示例6: AddArrowType

 public void AddArrowType(Enums.Arrows type)
 {
     if(type > 0 && type < Enums.Arrows.NumTypes)
     {
         // Find the running timer associated with the type
         TokenTimer t = timers.Find(i => i.ID.Equals(type.ToString()));
         // If the type has not been added yet
         if (t == null)
         {
             // Add a new Token Timer and initialize it
             TokenTimer tt = gameObject.AddComponent<TokenTimer>();
             tt.Initialize(TokenTimer.TOKEN_INTERVAL, type.ToString());
             // Make sure that the type is removed from the component when the timer times out
             tt.TimeOut += new TokenTimer.TimerEvent(RemoveToken);
             types = Bitwise.SetBit(types, (int)type);
             timers.Add(tt);
         }
         else
         {
             // Type has already been added so we just need to reset the timer
             t.Reset();
         }
     }
 }
开发者ID:ChenJonathan,项目名称:Rangers,代码行数:24,代码来源:Archery.cs

示例7: hasAppPermission

        /// <summary>
        /// Checks whether the user has opted in to an extended application permission.
        /// </summary>
        /// <param name="ext_perm">String identifier for the extended permission that is being checked for. Must be one of status_update or photo_upload.</param>
        /// <returns>Returns 1 or 0.</returns>
        public bool hasAppPermission(Enums.Extended_Permissions ext_perm)
        {
            var parameterList = new Dictionary<string, string>
                                    {
                                        {"method", "facebook.users.hasAppPermission"},
                                        {"ext_perm", ext_perm.ToString()}
                                    };

            var response = _api.SendRequest(parameterList);
            return string.IsNullOrEmpty(response) || users_hasAppPermission_response.Parse(response).TypedValue;
        }
开发者ID:taoxiease,项目名称:asegrp,代码行数:16,代码来源:users.cs

示例8: BootstrapErrorField

 public static MvcHtmlString BootstrapErrorField(this HtmlHelper helper, string id, Enums.MessageFieldStyle style)
 {
     var format = "<div id=\"{0}\" class=\"alert alert-{1}\" hidden />";
     return new MvcHtmlString(string.Format(format, id, style.ToString().ToLower()));
 }
开发者ID:gunnarsireus,项目名称:SireusMvc5,代码行数:5,代码来源:BootstrapMessageFields.cs

示例9: GetEffect

 /// <summary>
 /// Gets the prefab based on the arrow type.
 /// </summary>
 /// <param name="type">The type of arrow that needs a prefab.</param>
 /// <returns>The appropriate effect for the arrow property.</returns>
 public GameObject GetEffect(Enums.Arrows type)
 {
     return effectPrefabs.Find(x => x.name.StartsWith(type.ToString()));
 }
开发者ID:dvalles,项目名称:Rangers,代码行数:9,代码来源:AttackManager.cs

示例10: GetRandomJokeBasedOn

 public string GetRandomJokeBasedOn(Enums.Prisoner Prisoner)
 {
     int PositionToReturn = Random.Range(1,10);
     List<string> Joke;
     RandomGuyJokes.TryGetValue(Prisoner, out Joke);
     if(Joke != null && Joke.Count == 10)
     {
         Debug.Log("Joke for " + Prisoner.ToString() + " = " + Joke[PositionToReturn]);
         return Joke[PositionToReturn];
     }
     return "JokeNotFound";
 }
开发者ID:ryvianstyron,项目名称:PrisonAir,代码行数:12,代码来源:GameManager.cs

示例11: WriteOperateLogs

   /// <summary>
   /// 写后台管理员操作日志
   /// </summary>
   /// <param name="context"></param>
   /// <param name="doType"></param>
   /// <param name="module"></param>
   /// <param name="summary"></param>
   public static void WriteOperateLogs(Enums.Privilege doType,string module,string summary)
   {
       try
       {
 //         浏览者操作系统的默认语言  
 //Request.ServerVariables.Get("HTTP_ACCEPT_LANGUAGE")  
 //客户端ip:  
 //Request.ServerVariables.Get("Remote_Addr");  
 //客户端主机名:  
 //Request.ServerVariables.Get("Remote_Host");  
 //服务器ip:  
 //Request.ServerVariables.Get("Local_Addr");  
 //服务器名:  
 //Request.ServerVariables.Get("Server_Name");  
 //获得用户登陆名  
 //Request.ServerVariables.Get("LOGON_USER"); 
           HttpContext context = HttpContext.Current;
           HttpRequest request = context.Request;
           NT.Entities.User user = context.Session["Users"] as NT.Entities.User;
           NT.Entities.SystemLogs log = new NT.Entities.SystemLogs();
           log.Ip = "Ip:" + request.ServerVariables.Get("Remote_Addr") + " Host:" + request.ServerVariables.Get("Remote_Host") + "  Browser:" + getBrowser() + " Agent:" + SystemCheck() + " URL:" + request.RawUrl;
           log.Operater = user.UserName;
           log.UserId = user.UserId;
           log.Summary = summary;
           log.Module = module;
           log.DoType = doType.ToString();
           log.DoTime = System.DateTime.Now;
           NT.Data.DataRepository.SystemLogsProvider.Insert(log);
       }
       catch { }
   }
开发者ID:lakeli,项目名称:shizong,代码行数:38,代码来源:Logger.cs

示例12: JABBER_CLIENT_OnError

 void JABBER_CLIENT_OnError(Enums.ErrorType type, string message)
 {
     buttonTestConnection.BackColor = Color.Tomato;
     MessageBox.Show(message, "Jabber Error: " + type.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error);
     buttonTestConnection.Enabled = true;
 }
开发者ID:kevinmel2000,项目名称:mychitchat,代码行数:6,代码来源:Config.cs

示例13: GetSiteListFields

 /// <summary>
 /// 从多网站表单数据根据网站编码是提取该站字段
 /// </summary>
 /// <param name="lst"></param>
 /// <param name="sitecode">网站编号</param>
 /// <returns></returns>
 public static List<DbMetaEntity> GetSiteListFields(List<DbMetaEntity> lst, Enums.WebSites sitecode)
 {
     return GetListFields(lst, sitecode.ToString());
 }
开发者ID:lakeli,项目名称:shizong,代码行数:10,代码来源:DBA.cs

示例14: _jabberConnection_ErrorRaised

 void _jabberConnection_ErrorRaised(Enums.ErrorType type, string message)
 {
     Log.Error(String.Format("Jabber error: {0} {1}", type.ToString(), message));
     switch (type) {
         case Enums.ErrorType.Authentification:
             Log.Error("Your jabber username or password is invalid");
             break;
         case Enums.ErrorType.Server:
             Reconnect();
             break;
         case Enums.ErrorType.Warning:
         case Enums.ErrorType.Query:
             //do nothing for now
             break;
         case Enums.ErrorType.Client:
         default:
             Close();
             this._jabberConnection.Dispose();
             this._jabberConnection = new nJim.Jabber();
             Login();
             break;
     }
     OnError(type, message);
 }
开发者ID:kevinmel2000,项目名称:mychitchat,代码行数:24,代码来源:Client.cs

示例15: RemoveArrowType

		public void RemoveArrowType(Enums.Arrows type)
		{
			// Clear the appropriate token bit and remove the timer from the list of running timers
			types = Bitwise.ClearBit(types, (int) type);
			TokenTimer t = timers.Find(i => i.ID.Equals(type.ToString()));
			timers.Remove(t);
		}
开发者ID:szhangGT,项目名称:Rangers,代码行数:7,代码来源:Archery.cs


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