本文整理汇总了C#中System.Enums.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Enums.ToString方法的具体用法?C# Enums.ToString怎么用?C# Enums.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Enums
的用法示例。
在下文中一共展示了Enums.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BootstrapButton
public static MvcHtmlString BootstrapButton(this HtmlHelper helper, 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));
}
示例2: CreateNPC
/// <summary>
/// Creates a new npc and spawns it.
/// </summary>
/// <param name="id">The id of the npc.</param>
/// <param name="name">The name of the npc.</param>
/// <param name="location">The location of the npc.</param>
/// <param name="mesh">The mesh of the npc.</param>
/// <param name="avatar">The avatar of the npc.</param>
/// <param name="npctype">The type of the npc.</param>
/// <param name="flag">The flat of the npc.</param>
public static void CreateNPC(uint id, string name, Maps.MapPoint location, ushort mesh, byte avatar, Enums.NPCType npctype = Enums.NPCType.Normal, ushort flag = 2)
{
Entities.NPC npc = new ProjectX_V3_Game.Entities.NPC();
npc.EntityUID = id;
npc.Mesh = (ushort)(mesh * 10);
npc.Flag = flag;
npc.Name = name;
npc.X = location.X;
npc.Y = location.Y;
npc.NPCType = npctype;
npc.Avatar = avatar;
if (!location.Map.EnterMap(npc))
{
return;
}
if (Core.Kernel.NPCs.TryAdd(npc.EntityUID, npc))
{
IniFile npcini = new IniFile(ServerDatabase.DatabaseLocation + "\\NPCInfo\\" + id + ".ini", "Info");
npcini.WriteString("Name", name);
npcini.WriteString("Type", npctype.ToString());
npcini.Write<ushort>("MapID", location.MapID);
npcini.Write<ushort>("X", location.X);
npcini.Write<ushort>("Y", location.Y);
npcini.Write<ushort>("Flag", flag);
npcini.Write<ushort>("Mesh", mesh);
npcini.Write<byte>("Avatar", avatar);
npc.Screen.UpdateScreen(null);
}
}
示例3: ActionBase
public bool HasFinished { get; set; }//not implemented
protected ActionBase(Enums.ActionTypeId typeId)
{
ActionStatus = Enums.Status.Fail;
HasFinished = false;
Details = new List<string>();
TypeId = typeId;
Name = SplitCamelCase(typeId.ToString());
}
示例4: SetException
public static void SetException(Enums.ExceptionType exType, Exception ex)
{
if (TDay.Properties.Settings.Default.DebugMode)
{
FileStream FS = new FileStream(Application.CommonAppDataPath + "\\Logs\\" + "TDay_" + DateTime.Now.Date.ToShortDateString() + ".log", FileMode.OpenOrCreate, FileAccess.ReadWrite);
StreamWriter SW = new StreamWriter(FS);
SW.WriteLine("Error:" + exType.ToString());
SW.WriteLine("Message:" + ex.Message);
SW.WriteLine("Source:" + ex.Source);
SW.WriteLine("Data:" + ex.Data);
SW.Close();
FS.Close();
}
}
示例5: AddTask
public void AddTask(Enums.TaskAction action)
{
using (var model = new FileQueueEntities(ConnectionString))
{
var newTask = new IndexerTask
{
Id = Guid.NewGuid(),
Action = action.ToString(),
DateTime = DateTime.Now,
InstanceId = InstanceId
};
model.AddToIndexerTasks(newTask);
model.SaveChanges();
}
}
示例6: CreateCounty
public County CreateCounty(string name, Enums.Provinces province)
{
CountyTeam ct = new CountyTeam();
ct.Name = name;
County c = new County();
c.Name = name;
c.Province = province.ToString();
c.CountyTeam = ct;
context.Counties.Add(c);
context.SaveChanges();
return c;
}
示例7: UploadTemporaryMedia
/// <summary>
/// 新增临时素材(原上传媒体文件)
/// </summary>
/// <param name="accessTokenOrAppId"></param>
/// <param name="type"></param>
/// <param name="file"></param>
/// <param name="timeOut">代理请求超时时间(毫秒)</param>
/// <returns></returns>
public static ResultModels.TemporaryMaterialResult UploadTemporaryMedia(string appId, string appSecret, Enums.MaterialFileEnum type, string file)
{
var url = string.Format("http://api.weixin.qq.com/cgi-bin/media/upload?access_token={0}&type={1}", AccessToken.GetToken(appId, appSecret), type.ToString());
var fileDictionary = new Dictionary<string, string>();
fileDictionary["media"] = file;
return new ResultModels.TemporaryMaterialResult();// HttpUtility.Post.PostFileGetJson<ResultModels.TemporaryMaterialResult>(url, null, fileDictionary, null, timeOut: timeOut);
//return ApiHandlerWapper.TryCommonApi(accessToken =>
//{
// var url = string.Format("http://api.weixin.qq.com/cgi-bin/media/upload?access_token={0}&type={1}", accessToken, type.ToString());
// var fileDictionary = new Dictionary<string, string>();
// fileDictionary["media"] = file;
// return HttpUtility.Post.PostFileGetJson<UploadTemporaryMediaResult>(url, null, fileDictionary, null, timeOut: timeOut);
//}, accessTokenOrAppId);
}
示例8: GivenIAmUsingTheFollwing
public void GivenIAmUsingTheFollwing(Enums.MobileDevice Device)
{
this.InitializeNewTestResult(Device.ToString());
// See the BeforeAndAfter.cs class as this will execute all code before touching any steps.
//// Start the driver with the browser type being specified in the app.config
BaseClass.StartDriver(Enums.WebBrowser.Chrome);
//// Setting the time we want the browser to wait before we fail the tests
BaseClass.Driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0, 0, CustomConfiguration.WaitForResponse));
BaseClass.Driver.Manage().Timeouts().SetPageLoadTimeout(new TimeSpan(0, 0, 0, CustomConfiguration.WaitForResponse));
//// navigate to the website
BaseClass.Driver.Navigate().GoToUrl(CustomConfiguration.BaseSiteUrl);
//// Resize the browser to the mobile size we wish to use
//BaseClass.Driver.Manage().Window.Size = MobileDeviceSizes.Select(Device);
}
示例9: Panel
public Panel(HtmlHelper helper, string title, Enums.PanelStyle style = Enums.PanelStyle.Default)
{
_writer = helper.ViewContext.Writer;
var panelDiv = new TagBuilder("div");
panelDiv.AddCssClass("panel-" + style.ToString().ToLower());
panelDiv.AddCssClass("panel");
var panelHeadingDiv = new TagBuilder("div");
panelHeadingDiv.AddCssClass("panel-heading");
var heading3Div = new TagBuilder("h3");
heading3Div.AddCssClass("panel-title");
heading3Div.SetInnerText(title);
var panelBodyDiv = new TagBuilder("div");
panelBodyDiv.AddCssClass("panel-body");
panelHeadingDiv.InnerHtml = heading3Div.ToString();
string html = string.Format("{0}{1}{2}", panelDiv.ToString(TagRenderMode.StartTag), panelHeadingDiv, panelBodyDiv.ToString(TagRenderMode.StartTag));
_writer.Write(html);
}
示例10: WriteDetectedAsyncUsage
internal void WriteDetectedAsyncUsage(Enums.AsyncDetected type, string documentPath, IMethodSymbol symbol)
{
if (Enums.AsyncDetected.None != type)
{
string returntype;
if (symbol.ReturnsVoid)
returntype = "void ";
else
returntype = symbol.ReturnType.ToString();
Logs.AsyncClassifierLog.Info(@"{0};{1};{2};{3};{4};{5};{6};{7}", AppName, documentPath, type.ToString(), returntype, symbol.ContainingNamespace, symbol.ContainingType, symbol.Name, symbol.Parameters);
// Let's get rid of all generic information!
if (!symbol.ReturnsVoid)
returntype = symbol.ReturnType.OriginalDefinition.ToString();
Logs.AsyncClassifierOriginalLog.Info(@"{0};{1};{2};{3};{4};{5};{6};{7}", AppName, documentPath, type.ToString(), returntype, symbol.OriginalDefinition.ContainingNamespace, symbol.OriginalDefinition.ContainingType, symbol.OriginalDefinition.Name, ((IMethodSymbol)symbol.OriginalDefinition).Parameters);
}
}
示例11: containsType
private bool containsType(Invocation inv,Enums.Filter param)
{
if (Enum.IsDefined(typeof(Enums.Type), param.ToString()))
if (inv.type.Contains((Enums.Type)Enum.Parse(typeof(Enums.Type), param.ToString())))
return true;
return false;
}
示例12: MethodManipulation
public static void MethodManipulation(REngine engine, Enums.Methods method)
{
engine.Evaluate(String.Format("Fit <- {0}(tsValue)", method.ToString())); // Fit <- Arima(tsValue)
}
示例13: RankToString
public static string RankToString(Enums.ExplorerRank rank)
{
switch (rank) {
case Enums.ExplorerRank.Normal:
case Enums.ExplorerRank.Bronze:
case Enums.ExplorerRank.Silver:
case Enums.ExplorerRank.Gold:
case Enums.ExplorerRank.Diamond:
case Enums.ExplorerRank.Super:
case Enums.ExplorerRank.Ultra:
case Enums.ExplorerRank.Hyper:
case Enums.ExplorerRank.Master:
case Enums.ExplorerRank.Guildmaster:
return rank.ToString();
case Enums.ExplorerRank.MasterX:
return "Master*";
case Enums.ExplorerRank.MasterXX:
return "Master**";
case Enums.ExplorerRank.MasterXXX:
return "Master***";
default:
return "???";
}
}
示例14: YesYouCanCreateManaPool
public void YesYouCanCreateManaPool(Enums.Mana mana)
{
string enumString = mana.ToString();
GameEventManager.YesYouCanCreateManaPool(enumString);
}
示例15: sendOpponentPool
public void sendOpponentPool(Enums.Mana mana, int value)
{
string param = mana.ToString() + " " + value.ToString();
sendMessage(generateMessage(MessagesEnums.Message.OpponentPool, param));
}