本文整理汇总了C#中Option.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Option.ToString方法的具体用法?C# Option.ToString怎么用?C# Option.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Option
的用法示例。
在下文中一共展示了Option.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDerived
public static Choice GetDerived(Option option)
{
var assembly = typeof(Choice).Assembly;
var type = assembly.GetType(Choice.SubclassNamePrefix + option.ToString());
return (Choice)Activator.CreateInstance(type);
}
示例2: ToString_FewOptions_KeyValuePairsInString
public void ToString_FewOptions_KeyValuePairsInString()
{
Option options = new Option();
options.AddOption("baseLinkUrl", "home/getdata");
options.AddOption("id", 5);
string expected = "baseLinkUrl: 'home/getdata', id: 5".RemoveSpaces();
string actual = options.ToString().RemoveSpaces();
Assert.AreEqual(expected, actual);
}
示例3: DrawOption
private void DrawOption(Cairo.Context g, Option o)
{
Text.ShadowedText(g, o.ToString(),
X + x,
Y + (((int)o + 1) * y) + 5);
}
示例4: OptionsToString
protected virtual string OptionsToString()
{
var builder = new StringBuilder();
if (FirstOption != null)
{
var option = new Option {Value = FirstOptionValue, InnerText = FirstOption};
if (SelectedValues.Contains(option.Value))
{
option.Selected = true;
}
builder.Append(option.ToString());
}
foreach (var option in _options)
{
if (SelectedValues.Contains(option.Value))
{
option.Selected = true;
}
builder.Append(option.ToString());
}
return builder.ToString();
}
示例5: BuildDataTable
private DataTable BuildDataTable(bool IsToday, bool IsCollect, DateTime IsDate, Option reportType)
{
try
{
GetData(IsToday, IsCollect, IsDate, reportType.ToString());
}
catch (Exception ex)
{
m_sngOut = 0;
m_sngIN = 0;
m_sngAccCoinIn = 0;
m_sngAccNotes = 0;
m_sngAccTicketsIn = 0;
m_sngAccTicketsOut = 0;
m_sngAccCoinOut = 0;
m_sngAccHandpay = 0;
m_sngWL = 0;
lTicketQty = 0;
sngTicketValue = 0;
m_sngAccNonCashableTicketsIn = 0;
m_sngAccNonCashableTicketsOut = 0;
m_sngAccProgressiveJacpot = 0;
m_sngTicketValue = 0;
m_lTicketQty = 0;
ExceptionManager.Publish(ex);
LogManager.WriteLog("BuildDataTable", LogManager.enumLogLevel.Debug);
}
DataTable dtSiteSummary = new DataTable();
dtSiteSummary.Columns.Add("Description");
dtSiteSummary.Columns.Add("Value");
DataRow drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "Coins In";
drSiteSummary[0] = FindResource("CAnalysis_xaml_Datatable_DataRow_0") as string;
drSiteSummary[1] = m_sngAccCoinIn.GetUniversalCurrencyFormatWithSymbol();
dtSiteSummary.Rows.Add(drSiteSummary);
drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "Bills In";
drSiteSummary[0] = FindResource("CAnalysis_xaml_Datatable_DataRow_1") as string;
drSiteSummary[1] = m_sngAccNotes.GetUniversalCurrencyFormatWithSymbol();
dtSiteSummary.Rows.Add(drSiteSummary);
drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "Cashable Vouchers In";
drSiteSummary[0] = FindResource("CAnalysis_xaml_Datatable_DataRow_2") as string;
drSiteSummary[1] = m_sngAccTicketsIn.GetUniversalCurrencyFormatWithSymbol();
dtSiteSummary.Rows.Add(drSiteSummary);
drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "Non Cashable Vouchers In";
drSiteSummary[0] = FindResource("CAnalysis_xaml_Datatable_DataRow_16") as string;
drSiteSummary[1] = m_sngAccNonCashableTicketsIn.GetUniversalCurrencyFormatWithSymbol();
dtSiteSummary.Rows.Add(drSiteSummary);
if (Settings.IsAFTEnabledForSite)
{
drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "Cashable EFT In";
drSiteSummary[0] = FindResource("CAnalysis_xaml_Datatable_DataRow_10") as string;
drSiteSummary[1] = m_sngCashableEFTIn.GetUniversalCurrencyFormatWithSymbol();
dtSiteSummary.Rows.Add(drSiteSummary);
drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "Non Cashable EFT In";
drSiteSummary[0] = FindResource("CAnalysis_xaml_Datatable_DataRow_12") as string;
drSiteSummary[1] = m_sngNonCashableEFTIn.GetUniversalCurrencyFormatWithSymbol();
dtSiteSummary.Rows.Add(drSiteSummary);
drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "WAT In";
drSiteSummary[0] = FindResource("CAnalysis_xaml_Datatable_DataRow_14") as string;
drSiteSummary[1] = m_sngWATIn.GetUniversalCurrencyFormatWithSymbol();
dtSiteSummary.Rows.Add(drSiteSummary);
}
drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "Total Cash In";
drSiteSummary[0] = FindResource("CAnalysis_xaml_Datatable_DataRow_3") as string;
drSiteSummary[1] = m_sngIN.GetUniversalCurrencyFormatWithSymbol();
dtSiteSummary.Rows.Add(drSiteSummary);
//drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "";
//drSiteSummary[1] = "";
//dtSiteSummary.Rows.Add(drSiteSummary);
drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "Coins Out";
drSiteSummary[0] = FindResource("CAnalysis_xaml_Datatable_DataRow_4") as string;
drSiteSummary[1] = m_sngAccCoinOut.GetUniversalCurrencyFormatWithSymbol();
dtSiteSummary.Rows.Add(drSiteSummary);
drSiteSummary = dtSiteSummary.NewRow();
//drSiteSummary[0] = "Cashable Vouchers Out";
drSiteSummary[0] = FindResource("CAnalysis_xaml_Datatable_DataRow_5") as string;
drSiteSummary[1] = m_sngAccTicketsOut.GetUniversalCurrencyFormatWithSymbol();
dtSiteSummary.Rows.Add(drSiteSummary);
//.........这里部分代码省略.........
示例6: Play
public string Play(Option userPlay, Option computerPlay)
{
var move = userPlay.ToString().Substring(0, 1) + computerPlay.ToString().Substring(0, 1);
Result result = PossibleCombos[move];
RecordedUserMoves.Add(userPlay);
return string.Format("User: {0}, AI: {1} ---- Results: {2}", userPlay, computerPlay, result);
}