/// <summary>
        /// 通知当前的字符值;
        /// </summary>
        /// <param name="hexContext"></param>
        private static void ShowChar(IHexDataContext hexContext)
        {
            var curCharValueItem = StatusBarService.Current.GetOrCreateStatusBarTextItem(Constants.StatusBarItemGUID_CurCharValue, _curCharValueChildLength, 8);

            if (curCharValueItem == null)
            {
                return;
            }

            try {
                var stream = hexContext.Stream;
                if (stream == null)
                {
                    LoggerService.WriteCallerLine($"{nameof(stream)} can't be null.");
                    return;
                }

                stream.Position = hexContext.FocusPosition;
                StatusBarService.Report(
                    $"{LanguageService.FindResourceString(Constants.StatusBarItemText_CurCharValue)} {stream.ReadByte()}",
                    Constants.StatusBarItemGUID_CurCharValue);
            }
            catch (Exception ex) {
                LoggerService.WriteCallerLine(ex.Message);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 画布当前鼠标位置发生变化时,通知状态栏;
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CanvasDataContext_CurrentMousePositionChanged(ICanvasDataContext canvasDataContext)
        {
            var currentPosition = CanvasService.CanvasDataContext.CurrentMousePosition;

            if (currentPosition == null)
            {
                return;
            }

            StatusBarService.Report(
                LanguageService.TryGetStringWithFormat(
                    Constants.LanguageFormat_CurrentMousePosition,
                    currentPosition.X.ToString("F4"),
                    currentPosition.Y.ToString("F4")
                    )
                );
        }
        /// <summary>
        /// 通知位置;
        /// </summary>
        /// <param name="hexContext"></param>
        private static void NotifyPosition(IHexDataContext hexContext)
        {
            var positionItem = StatusBarService.Current.GetOrCreateStatusBarTextItem(Constants.StatusBarItemGUID_Position, _positionChildLength, 4);

            if (positionItem == null)
            {
                return;
            }

            try {
                StatusBarService.Report(
                    $"{LanguageService.FindResourceString(Constants.StatusBarItemText_Position)} {hexContext.FocusPosition}",
                    Constants.StatusBarItemGUID_Position
                    );
            }
            catch (Exception ex) {
                LoggerService.WriteCallerLine(ex.Message);
            }
        }
Exemplo n.º 4
0
 public void Handle()
 {
     StatusBarService.Current.Initialize();
     //导航默认文字状态栏为欢迎(龙骨编辑器——悉道);
     StatusBarService.Report(LanguageService.FindResourceString(Constants.StatusBarBrandText));
 }