本文整理汇总了C#中System.Operation.GetDestinationLocation方法的典型用法代码示例。如果您正苦于以下问题:C# Operation.GetDestinationLocation方法的具体用法?C# Operation.GetDestinationLocation怎么用?C# Operation.GetDestinationLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Operation
的用法示例。
在下文中一共展示了Operation.GetDestinationLocation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StringBuilder
void IJob.DoJob(Operation operation)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("Einsatznummer: {0}", operation.OperationNumber).AppendLine();
sb.AppendFormat("Einsatzort: {0}", operation.GetDestinationLocation());
// Send notification via each growl sender
_growlSender.ForEach(gs =>
{
try
{
gs.SendNotification(this, "Neuer Alarm!", sb.ToString());
}
catch (Exception ex)
{
Logger.Instance.LogFormat(LogType.Warning, this, "Could not send Growl notification! See log for information.");
Logger.Instance.LogException(this, ex);
}
});
}
示例2: SetContentToLatestAlarm
private void SetContentToLatestAlarm(Operation operation)
{
// TODO: Find a more elegant way than just switching the panels' visibility!
pnlProgress.Visible = false;
pnlAlarm.Visible = true;
pnlNoAlarm.Visible = false;
// TODO
tcOperationNumber.Text = operation.OperationNumber;
tcTimestamp.Text = operation.Timestamp.ToLocalTime().ToString();
tcDestinationLocation.Text = operation.GetDestinationLocation().ToString();
tcKeyword.Text = operation.Keyword;
tcMessenger.Text = operation.Messenger;
tcComment.Text = operation.Comment;
LoadOperationRouteImage(operation);
}
示例3: DownloadRoutePlan
private byte[] DownloadRoutePlan(Operation operation)
{
PropertyLocation source = GetFDLocation();
if (!source.IsMeaningful)
{
Logger.Instance.LogFormat(LogType.Warning, this, Resources.RoutePlanningSourceLocationNotMeaningful, source);
return null;
}
PropertyLocation destination = operation.GetDestinationLocation();
if (!operation.GetDestinationLocation().IsMeaningful)
{
Logger.Instance.LogFormat(LogType.Warning, this, Resources.DestinationLocationIsUnknown);
return null;
}
Logger.Instance.LogFormat(LogType.Trace, this, Resources.DownloadRoutePlanBegin, destination.ToString());
Stopwatch sw = Stopwatch.StartNew();
try
{
byte[] imageBuffer = GoogleMapsProvider.GetRouteImage(source, destination);
sw.Stop();
if (imageBuffer == null)
{
Logger.Instance.LogFormat(LogType.Warning, this, Resources.DownloadRoutePlanFailed);
}
else
{
Logger.Instance.LogFormat(LogType.Trace, this, Resources.DownloadRoutePlanSuccess, sw.ElapsedMilliseconds);
}
return imageBuffer;
}
catch (Exception ex)
{
sw.Stop();
Logger.Instance.LogFormat(LogType.Error, this, Resources.DownloadRoutePlanError);
Logger.Instance.LogException(this, ex);
}
return null;
}
示例4: DownloadRoutePlan
/// <summary>
/// Downloads the route planning info if it is enabled and the location datas are meaningful enough.
/// </summary>
/// <param name="operation"></param>
private void DownloadRoutePlan(Operation operation)
{
if (!AlarmWorkflowConfiguration.Instance.DownloadRoutePlan)
{
return;
}
// Get start address and check if it is meaningful enough (if not then bail out)
PropertyLocation source = AlarmWorkflowConfiguration.Instance.FDInformation.Location;
if (!source.IsMeaningful)
{
Logger.Instance.LogFormat(LogType.Warning, this, "Cannot download route plan because the location information for this fire department is not meaningful enough: '{0}'. Please fill the correct address!", source);
return;
}
// Get destination address and check if it is meaningful enough (if not then bail out)
PropertyLocation destination = operation.GetDestinationLocation();
if (!operation.GetDestinationLocation().IsMeaningful)
{
Logger.Instance.LogFormat(LogType.Warning, this, "Destination location is unknown! Cannot download route plan!");
}
else
{
Logger.Instance.LogFormat(LogType.Trace, this, "Downloading route plan to destination '{0}'...", destination.ToString());
Stopwatch sw = Stopwatch.StartNew();
try
{
Image image = _routePlanProvider.GetRouteImage(source, destination);
if (image != null)
{
// Save the image as PNG
using (MemoryStream ms = new MemoryStream())
{
image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
operation.RouteImage = ms.ToArray();
}
}
sw.Stop();
if (operation.RouteImage == null)
{
Logger.Instance.LogFormat(LogType.Warning, this, "The download of the route plan did not succeed. Please check the log for information!");
}
else
{
Logger.Instance.LogFormat(LogType.Trace, this, "Downloaded route plan in '{0}' milliseconds.", sw.ElapsedMilliseconds);
}
}
catch (Exception ex)
{
sw.Stop();
Logger.Instance.LogFormat(LogType.Error, this, "An error occurred while trying to download the route plan! The image will not be available.");
Logger.Instance.LogException(this, ex);
}
}
}