Ejemplo n.º 1
0
 /// <summary>
 /// 创建消息
 /// </summary>
 private LogMessage CreateMessage()
 {
     return(new LogMessage()
     {
         Level = Level.Description(),
         TraceId = TraceId,
         Time = DateTime.Now.ToMillisecondString(),
         TotalSeconds = GetTotalSeconds(),
         Url = GetUrl(),
         BusinessId = BusinessId,
         Application = GetApplication(),
         Tenant = GetTenant(),
         Category = Category,
         Class = Class,
         Method = Method,
         Params = Params.ToString(),
         Ip = Net.Ip,
         Host = Net.Host,
         ThreadId = Thread.ThreadId,
         UserId = GetIdentity().UserId,
         Operator = GetIdentity().FullName,
         Role = GetIdentity().Role,
         Caption = Caption.ToString(),
         Content = Content.ToString(),
         Sql = Sql.ToString(),
         SqlParams = SqlParams.ToString(),
         ErrorCode = ErrorCode,
         Error = ErrorMessage,
         StackTrace = StackTrace
     });
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 创建消息
 /// </summary>
 private LogMessage CreateMessage()
 {
     //TODO:消息需要再次详细初始化
     return(new LogMessage
     {
         Level = "",//Level.Description(),
         TraceId = TraceId,
         Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
         //TotalSeconds = GetTotalSeconds(),
         Url = GetUrl(),
         Application = GetApplication(),
         Class = Class,
         Method = Method,
         Params = Params.ToString(),
         Ip = Net.Ip,
         Host = Net.Host,
         ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(),
         UserId = "",
         Operator = "",
         Role = "",
         Caption = Caption.ToString(),
         Content = Content.ToString(),
         Sql = Sql.ToString(),
         SqlParams = SqlParams.ToString(),
         ErrorCode = ErrorCode,
         Error = _errorMessage,
         StackTrace = _stackTrace
     });
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Chart 설정 또는 변량에 대해 XML 속성으로 생성합니다.
        /// </summary>
        /// <param name="writer">xml writer</param>
        public override void GenerateXmlAttributes(System.Xml.XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (Canvas.HasValue)
            {
                writer.WriteAttributeString("canvas" + PaddingSuffix, Canvas.ToString());
            }
            if (Caption.HasValue)
            {
                writer.WriteAttributeString("Caption" + PaddingSuffix, Caption.ToString());
            }
            if (XAxisName.HasValue)
            {
                writer.WriteAttributeString("XAxisName" + PaddingSuffix, XAxisName.ToString());
            }
            if (YAxisName.HasValue)
            {
                writer.WriteAttributeString("YAxisName" + PaddingSuffix, YAxisName.ToString());
            }
            if (YAxisValues.HasValue)
            {
                writer.WriteAttributeString("YAxisValues" + PaddingSuffix, YAxisValues.ToString());
            }
            if (Label.HasValue)
            {
                writer.WriteAttributeString("Label" + PaddingSuffix, Label.ToString());
            }
            if (Value.HasValue)
            {
                writer.WriteAttributeString("Value" + PaddingSuffix, Value.ToString());
            }
        }
Ejemplo n.º 4
0
 public void OnReadObject()
 {
     if (string.IsNullOrEmpty(IconClass))
     {
         IconClass = fDefaultIconClass;
     }
     OperatorCaption = Caption == null ? fDefaultCaption : Caption.ToString();
 }
Ejemplo n.º 5
0
 public override string ToString()
 {
     if (Caption == null)
     {
         return(base.ToString());
     }
     return(Caption.ToString());
 }
Ejemplo n.º 6
0
 public MenuButton CreateObject(params object[] args)
 {
     MenuButton[] sub = new MenuButton[fButtons.Count];
     for (int i = 0; i < fButtons.Count; i++)
     {
         sub[i] = fButtons[i].CreateObject();
     }
     return(MenuButton.CreateMenu(Caption.ToString(), sub));
 }
Ejemplo n.º 7
0
 private void tabHeader_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (!closing)
     {
         tabHeader_MouseLeave(null, null);
         // проверяем состояние нажатия Ctrl
         var ctrl = Keyboard.GetKeyStates(Key.LeftCtrl);
         if ((ctrl & KeyStates.Down) > 0)
         {
             if (WorkPage.CurrentSplit != null)
             {
                 IsChecked = false;
                 Manager.UI.ShowMessage("Объединить можно только 2 закладки!");
                 return;
             }
             // создание Split-окна
             var tabContainer = WorkPage.CurrentPage.FindName("tabContainer") as Grid;
             tabContainer.Children.Remove(WorkPage.ActiveHeader.ArmModule);
             tabContainer.Children.Remove(ArmModule);
             IsSplit = WorkPage.ActiveHeader.IsSplit = true;
             ArmModule.Visibility  = Visibility.Visible;
             WorkPage.CurrentSplit = new SplitHost();
             IsChecked             = true;
             WorkPage.CurrentSplit.LeftPanel.Content  = WorkPage.ActiveHeader.ArmModule;
             WorkPage.CurrentSplit.LeftPanel.Title    = WorkPage.ActiveHeader.Caption.ToString();
             WorkPage.CurrentSplit.RightPanel.Content = ArmModule;
             WorkPage.CurrentSplit.RightPanel.Title   = Caption.ToString();
             var grid = WorkPage.CurrentPage.FindName("tabContainer") as Grid;
             if (grid != null)
             {
                 grid.Children.Add(WorkPage.CurrentSplit);
             }
         }
         else
         {
             IsWarning = false;
             try
             {
                 Common.Manager.UI.SetActiveTab(this);
             }
             catch
             {
             }
         }
     }
     else
     {
         closing = false;
     }
 }
Ejemplo n.º 8
0
        public override string ToString()
        {
            int a = int.Parse(Capacity.ToString()) / 1024 / 1024;

            return(a.ToString() + "MB" + Caption.ToString());
        }
Ejemplo n.º 9
0
 public override void FontChanged(string newFont)
 {
     base.FontChanged(newFont);
     Caption = Caption.ToString();
 }
Ejemplo n.º 10
0
 public override string ToString()
 {
     return(Caption.ToString());
 }
Ejemplo n.º 11
0
 public override string ToString()
 {
     return(string.Format("{0} (\\{1})", Caption.ToString(), DisplayFolder.ToString()));
 }
Ejemplo n.º 12
0
        public MenuButton CreateObject(params object[] args)
        {
            string url = Url.ToUri();

            return(MenuButton.CreateViewMenu(Caption.ToString(), url));
        }
Ejemplo n.º 13
0
        private void caption_Loaded(object sender, RoutedEventArgs e)
        {
            var tb = sender as TextBlock;

            tb.Text = Caption.ToString();
        }
Ejemplo n.º 14
0
        public CloseAction Close()
        {
            tabHeader_MouseLeave(null, null);
            var module = ArmModule as IModule;

            if (module != null)
            {
                var fe = module as FrameworkElement;
                if (fe != null)
                {
                    GetModuleSettings(fe);
                }

                var answer = module.Close();
                if (answer != CloseAction.CancelClose)
                {
                    closing = true;
                    Manager.UI.CloseAllPopups();
                    PopupBase.CloseAllPopups();
                    var tabs = this.Parent as StackPanel;
                    if (tabs != null)
                    {
                        var workPage = WorkPage.CurrentPage;

                        for (int i = 0; i < tabs.Children.Count; i++)
                        {
                            var tab = tabs.Children[i];
                            if (tab == this)
                            {
                                var page = workPage as WorkPage;
                                if (page != null)
                                {
                                    page.tabs.Tabs.RemoveAt(i);
                                }

                                if (i == tabs.Children.Count)
                                {
                                    i--;
                                }
                                if (i == -1)
                                {
                                    WorkPage.ActiveHeader = null;
                                    break;
                                }
                                Common.Manager.UI.SetActiveTab(tabs.Children[i]);
                                break;
                            }
                        }
                        ArmModule.Visibility = Visibility.Hidden;
                        if (answer == CloseAction.HideToHistory)
                        {
                            //Прячем в историю
                            var history = (WorkPage.CurrentPage as WorkPage).HistoryContent;
                            if (history != null)
                            {
                                history.Children.Insert(0, WorkPage.BuildShortcutFromModule(module, ArmModule.DataContext, Caption.ToString(), ModuleDrawingBrushName, false));
                            }
                        }
                        //else
                        //{
                        //Полное закрытие
                        var tc = workPage.FindName("tabContainer") as Grid;
                        if (tc != null)
                        {
                            tc.Children.Remove(ArmModule);
                        }
                        try
                        {
                            if (ArmModule != null)
                            {
                                ArmModule.DataContext = null;
                            }

                            var disp = ArmModule as IDisposable;
                            if (disp != null)
                            {
                                disp.Dispose();
                            }
                        }
                        catch { }

                        WorkPage.InitializedModules.Remove(module);
                        LastClosed = null;
                        //}
                        this.ArmModule = null;
                    }
                }
                if (Header.AllTabs != null)
                {
                    var item = Header.AllTabs.List.First(i => i.Key == this);
                    Header.AllTabs.List.Remove(item);
                }

                GC.Collect();

                return(answer);
            }
            return(CloseAction.Сlose);
        }
Ejemplo n.º 15
0
 public MenuButton CreateObject(params object[] args)
 {
     return(MenuButton.CreateKeyMenu(fButtonType, Caption.ToString(), Key));
 }