当前位置: 首页>>代码示例>>C#>>正文


C# Operation.GetDestinationLocation方法代码示例

本文整理汇总了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);
                }
            });
        }
开发者ID:The-Stig,项目名称:AlarmWorkflow,代码行数:20,代码来源:GrowlJob.cs

示例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);
        }
开发者ID:Knatter33,项目名称:AlarmWorkflow,代码行数:17,代码来源:Default.aspx.cs

示例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;
        }
开发者ID:Bolde,项目名称:AlarmWorkflow,代码行数:45,代码来源:OperationToRouteImageConverter.cs

示例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);
                }
            }
        }
开发者ID:The-Stig,项目名称:AlarmWorkflow,代码行数:64,代码来源:AlarmWorkflowEngine.cs


注:本文中的System.Operation.GetDestinationLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。