Example #1
0
        private void SetTitleText()
        {
            if (this.appWorkspace == null)
            {
                return;
            }

            if (this.appWorkspace.ActiveDocumentWorkspace == null)
            {
                this.Text = PdnInfo.GetAppName();
            }
            else
            {
                string appTitle     = PdnInfo.GetAppName();
                string ratio        = string.Empty;
                string title        = string.Empty;
                string friendlyName = this.appWorkspace.ActiveDocumentWorkspace.GetFriendlyName();
                string text;

                if (this.WindowState != FormWindowState.Minimized)
                {
                    string format = PdnResources.GetString("MainForm.Title.Format.Normal");
                    text = string.Format(format, friendlyName, appWorkspace.ActiveDocumentWorkspace.ScaleFactor, appTitle);
                }
                else
                {
                    string format = PdnResources.GetString("MainForm.Title.Format.Minimized");
                    text = string.Format(format, friendlyName, appTitle);
                }

                if (appWorkspace.ActiveDocumentWorkspace.Document != null)
                {
                    title = text;
                }

                this.Text = title;
            }
        }