Пример #1
0
        public static bool MakeDir(string strPath, ApplicationWindow parent)
        {
            if (String.IsNullOrEmpty(strPath))
            {
                return(false);
            }

            strPath = strPath.BackSlash(false);
            if (Strings.DirExists(strPath))
            {
                return(true);
            }
            else
            {
                try
                {
                    System.IO.Directory.CreateDirectory(strPath);
                }
                catch (Exception ex)
                {
                    ex.LogError();
                    if (parent != null)
                    {
                        parent.ShowError(ex);
                    }
                    return(false);
                }

                return(true);
            }
        }
        public ApplicationWindowDiagnostics(ApplicationWindow owner, int nFrames = 5)
        {
            Owner = owner;

            PanelPaint  = new StatusTextPanel("diagnostics_paint", Docking.Right);
            PanelLayout = new StatusTextPanel("diagnostics_layout", Docking.Right);

            style = new ApplicationWindowDiagnosticStyle();
            PanelPaint.Styles.SetStyle(style, WidgetStates.Default);
            PanelLayout.Styles.SetStyle(style, WidgetStates.Default);

            PanelPaint.Click  += Panel_Click;
            PanelLayout.Click += Panel_Click;

            //PanelLayout.Style.BackColorBrush.Color = SolarizedColors.Green;
            //PanelPaint.Style.BackColorBrush.Color = SolarizedColors.Cyan;

            Owner.StatusBar.AddChild(PanelPaint);
            Owner.StatusBar.AddChild(PanelLayout);

            LayoutMeter = new FramePerformanceMeter(nFrames);
            PaintMeter  = new FramePerformanceMeter(nFrames);

            PanelPaint.InvalidateOnHeartBeat  = true;
            PanelLayout.InvalidateOnHeartBeat = true;

            Owner.Controls.SubscribeHeartbeat(PanelPaint);
            Owner.Controls.SubscribeHeartbeat(PanelLayout);
        }
Пример #3
0
 protected override void OnParentChanged()
 {
     base.OnParentChanged();
     if (Parent != null)
     {
         AppWin = ParentWindow as ApplicationWindow;
     }
     else
     {
         AppWin = null;
     }
 }
Пример #4
0
 public static void OpenURL(string url, ApplicationWindow parent)
 {
     if (!String.IsNullOrEmpty(url))
     {
         try
         {
             Process.Start(url);
         }
         catch (Exception ex)
         {
             ex.LogError();
             if (parent != null)
             {
                 parent.ShowError(ex);
             }
         }
     }
 }