本文整理汇总了C#中Priority.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Priority.ToString方法的具体用法?C# Priority.ToString怎么用?C# Priority.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Priority
的用法示例。
在下文中一共展示了Priority.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Log
/// <summary>
/// Write a new log entry with the specified category and priority.
/// </summary>
/// <param name="message">Message body to log.</param>
/// <param name="category">Category of the entry.</param>
/// <param name="priority">The priority of the entry.</param>
public void Log(string message, Category category, Priority priority)
{
string messageToLog = String.Format(CultureInfo.InvariantCulture, Resources.DefaultTextLoggerPattern, DateTime.Now,
category.ToString().ToUpper(CultureInfo.InvariantCulture), message, priority.ToString());
writer.WriteLine(messageToLog);
}
示例2: Log
public void Log(string message, Category category, Priority priority)
{
_bootLogger.Log(String.Format("{0}|{1}: {2}",
FormatString(category.ToString(), 9),
FormatString(priority.ToString(), 6),
message));
}
示例3: LogException
public void LogException(string message, Exception exception, Priority priority)
{
_bootLogger.Log(String.Format("{0}|{1}: {2}",
FormatString(Category.Exception.ToString(), 9),
FormatString(priority.ToString(), 6),
message), exception);
}
示例4: WithTaskPriority
public InspectAllTapesSpectraS3Request WithTaskPriority(Priority? taskPriority)
{
this._taskPriority = taskPriority;
if (taskPriority != null)
{
this.QueryParams.Add("task_priority", taskPriority.ToString());
}
else
{
this.QueryParams.Remove("task_priority");
}
return this;
}
示例5: WithPriority
public CompactPoolSpectraS3Request WithPriority(Priority? priority)
{
this._priority = priority;
if (priority != null)
{
this.QueryParams.Add("priority", priority.ToString());
}
else
{
this.QueryParams.Remove("priority");
}
return this;
}
示例6: Log
/// <summary>
/// Write a new log entry with the specified category and priority.
/// </summary>
/// <param name="message">Message body to log.</param>
/// <param name="category">Category of the entry.</param>
/// <param name="priority">The priority of the entry.</param>
public void Log(string message, Category category, Priority priority)
{
var formattedMessage = string.Format("[{0}, {1}] {2}",
category.ToString(), priority.ToString(), message);
switch (category)
{
case Category.Debug:
case Category.Info:
Trace.TraceInformation(formattedMessage);
break;
case Category.Warn:
Trace.TraceWarning(formattedMessage);
break;
case Category.Exception:
Trace.TraceError(formattedMessage);
break;
}
}
示例7: PrettyString
public static string PrettyString(Priority p)
{
return p.ToString ().Replace ('_', ' ').ToLower ();
}
示例8: Create
public int Create(string externalKey, string layoutHtml, Priority priority = Priority.Medium)
{
if (externalKey.Length > Guid.Empty.ToString().Length)
{
throw new ArgumentException(
"externalKey too long, should be max length of " + Guid.Empty.ToString().Length, "externalKey");
}
if (_triggeredSendDefinitionClient.DoesTriggeredSendDefinitionExist(externalKey))
{
throw new Exception(string.Format("A TriggeredSendDefinition with external key {0} already exsits",
externalKey));
}
var dataExtensionExternalKey = ExternalKeyGenerator.GenerateExternalKey("data-extension-" + externalKey);
if (!_dataExtensionClient.DoesDataExtensionExist(dataExtensionExternalKey))
{
var dataExtensionTemplateObjectId =_dataExtensionClient.RetrieveTriggeredSendDataExtensionTemplateObjectId();
var dataExtensionFieldNames = new HashSet<string> {"Subject"};
var replacementFieldNames = LayoutHtmlReplacementFieldNameParser.Parse(layoutHtml);
foreach (var replacementFieldName in replacementFieldNames)
{
dataExtensionFieldNames.Add(replacementFieldName);
}
_dataExtensionClient.CreateDataExtension(dataExtensionTemplateObjectId,
dataExtensionExternalKey,
"triggeredsend-" + externalKey,
dataExtensionFieldNames);
}
var emailName = "email-" + externalKey;
var emailExternalKey = ExternalKeyGenerator.GenerateExternalKey("email-" + externalKey);
layoutHtml += EmailContentHelper.GetOpenTrackingTag() +
EmailContentHelper.GetCompanyPhysicalMailingAddressTags();
var emailId = _emailRequestClient.CreateEmail(emailExternalKey, emailName, "%%Subject%%",
layoutHtml);
var deliveryProfileExternalKey = ExternalKeyGenerator.GenerateExternalKey("blank-delivery-profile");
_deliveryProfileClient.TryCreateBlankDeliveryProfile(deliveryProfileExternalKey);
return _triggeredSendDefinitionClient.CreateTriggeredSendDefinition(externalKey,
emailId,
dataExtensionExternalKey,
deliveryProfileExternalKey,
externalKey,
externalKey,
priority.ToString());
}
示例9: CreateNotification
/*
* Invoked when showNotificationButton is clicked.
* Creates a new notification and sets metadata passed as arguments.
*/
public Notification CreateNotification(Priority priority, Category category, Uri contactUri)
{
var builder = new Notification.Builder (Activity)
.SetContentTitle ("Notification with other metadata")
.SetSmallIcon (Resource.Drawable.ic_launcher_notification)
.SetPriority ((int)priority.priority)
.SetCategory (category.ToString ())
.SetContentText(string.Format("Category {0}, Priority {1}",category.ToString(),priority.ToString()));
if (contactUri != null) {
builder.AddPerson (contactUri.ToString ());
Bitmap photoBitmap = LoadBitmapFromContactUri (contactUri);
if (photoBitmap != null)
builder.SetLargeIcon (photoBitmap);
}
return builder.Build ();
}
示例10: GetInsertString
private string GetInsertString(TaskQueueData oTask, Priority ePriority)
{
string sData = TaskQueueData.SerializeToXml(oTask);
return "INSERT INTO " + m_cstrTableName + " ( cq_data, cq_priority, cq_time, cq_isbusy ) VALUES ( '" + sData + "', '" + ePriority.ToString("d") + "', '" + DateTime.UtcNow.ToString(Constants.mc_sDateTimeFormat) + "', '" + BusyType.not_busy.ToString("d") + "' );";
}
示例11: FormatMessage
private string FormatMessage(string message, Category category, Priority priority)
{
return string.Format("[{0} {1}] {2}", category.ToString(), priority.ToString(), message);
}
示例12: Do
/// <summary>
/// Does the specified action while logging contextual information.
/// </summary>
/// <param name="tag"> The tag. </param>
/// <param name="priority"> The priority. </param>
/// <param name="author"> The author. </param>
/// <param name="description"> The description. </param>
/// <param name="action"> The action. </param>
private static void Do(string tag, Priority priority, string author, string description, Action action)
{
if (IsLoggingEnabled)
{
var stackTrace = new StackTrace();
var methodName = stackTrace.GetFrame(2).GetMethod().Name;
var className = stackTrace.GetFrame(2).GetMethod().DeclaringType.FullName;
var lineNumber = stackTrace.GetFrame(2).GetFileLineNumber();
var fileName = stackTrace.GetFrame(2).GetFileName();
var format = "{0} - Priority: {1}, Author: {2}, Description: {3}" + Environment.NewLine
+ "At {4}.{5}, File: {6}, Line{7}" + Environment.NewLine;
var message = string.Format(format, tag, priority.ToString(), author, description, className,
methodName, fileName, lineNumber);
_log.Info(message);
}
// Now Run the action.
action();
}
示例13: WithDefaultVerifyDataAfterImport
public ModifyDataPathBackendSpectraS3Request WithDefaultVerifyDataAfterImport(Priority? defaultVerifyDataAfterImport)
{
this._defaultVerifyDataAfterImport = defaultVerifyDataAfterImport;
if (defaultVerifyDataAfterImport != null)
{
this.QueryParams.Add("default_verify_data_after_import", defaultVerifyDataAfterImport.ToString());
}
else
{
this.QueryParams.Remove("default_verify_data_after_import");
}
return this;
}
示例14: WithVerifyPriorToAutoEject
public ModifyStorageDomainSpectraS3Request WithVerifyPriorToAutoEject(Priority? verifyPriorToAutoEject)
{
this._verifyPriorToAutoEject = verifyPriorToAutoEject;
if (verifyPriorToAutoEject != null)
{
this.QueryParams.Add("verify_prior_to_auto_eject", verifyPriorToAutoEject.ToString());
}
else
{
this.QueryParams.Remove("verify_prior_to_auto_eject");
}
return this;
}
示例15: GetInsertString
private string GetInsertString(TaskQueueData oTask, Priority ePriority)
{
string sData = TaskQueueData.SerializeToXml(oTask);
return string.Format("INSERT INTO {0} " +
"(cq_data, cq_priority, cq_update_time, cq_create_time, cq_isbusy) " +
"VALUES ('{1}', '{2}', '{3}', '{3}', '{4}');",
m_cstrTableName,
Utils.MySqlEscape(sData, m_sConnectionString),
ePriority.ToString("d"),
DateTime.UtcNow.ToString(Constants.mc_sDateTimeFormat),
BusyType.not_busy.ToString("d"));
}