本文整理汇总了C#中Shared.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Shared.ToString方法的具体用法?C# Shared.ToString怎么用?C# Shared.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shared
的用法示例。
在下文中一共展示了Shared.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
void IUIWidget.OnOperationChange(Shared.Core.Operation operation)
{
string lineOne = operation != null ? operation.ToString(SettingsManager.Instance.GetSetting("OperationWidget", "LineOne").GetString()) : "(n/A)";
string lineTwo = operation != null ? operation.ToString(SettingsManager.Instance.GetSetting("OperationWidget", "LineTwo").GetString()) : "(n/A)";
string lineThree = operation != null ? operation.ToString(SettingsManager.Instance.GetSetting("OperationWidget", "LineThree").GetString()) : "(n/A)";
LineOne.Inlines.Clear();
LineOne.Inlines.Add(Helper.Traverse(lineOne));
LineTwo.Inlines.Clear();
LineTwo.Inlines.Add(Helper.Traverse(lineTwo));
LineThree.Inlines.Clear();
LineThree.Inlines.Add(Helper.Traverse(lineThree));
}
示例2: ToString_returns_a_string_representation_of_the_object
public void ToString_returns_a_string_representation_of_the_object()
{
var shared = new Shared<object>();
const string expected = "Shared<System.Object>";
Assert.AreEqual(expected, shared.ToString());
}
示例3: Log
public void Log(Shared.Category category, string message)
{
var msg = string.Format("{0} {1}: {2}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), category.ToString().ToUpper(), message);
sb.AppendLine(msg);
}
示例4:
void IUIWidget.OnOperationChange(Shared.Core.Operation operation)
{
string lineOne = null;
if (!string.IsNullOrWhiteSpace(_expressionLineOne))
{
lineOne = operation != null ? operation.ToString(_expressionLineOne) : "(n/A)";
}
string lineTwo = null;
if (!string.IsNullOrWhiteSpace(_expressionLineTwo))
{
lineTwo = operation != null ? operation.ToString(_expressionLineTwo) : "(n/A)";
}
string lineThree = null;
if (!string.IsNullOrWhiteSpace(_expressionLineThree))
{
lineThree = operation != null ? operation.ToString(_expressionLineThree) : "(n/A)";
}
LineOne.Inlines.Clear();
LineTwo.Inlines.Clear();
LineThree.Inlines.Clear();
LineOne.Inlines.Add(Helper.Execute(lineOne));
LineTwo.Inlines.Add(Helper.Execute(lineTwo));
LineThree.Inlines.Add(Helper.Execute(lineThree));
}
示例5: FormatLine
private string FormatLine(string expression, Shared.Core.Operation operation)
{
if (!string.IsNullOrWhiteSpace(expression))
{
try
{
return operation != null ? operation.ToString(expression) : "(n/A)";
}
catch (AssertionFailedException)
{
// This exception may occure if the format of the value is broken or other problems with the format exist...
return string.Empty;
}
}
return string.Empty;
}