示例#1
0
        public override void DocumentConfig(EDocumentConfigType configType)
        {
            StringBuilder RetVal = new StringBuilder();

            switch (configType)
            {
            case EDocumentConfigType.Full:
                #region --- Full config --------------------------------------------
                RetVal.AppendLine(MakeSectionTitle($"Server version : {_SqlServer.VersionString}"));
                RetVal.AppendLine($"Instance name     = {_SqlServer.InstanceName}");
                RetVal.AppendLine($"In cluster        = {(_SqlServer.IsClustered ? "Yes" : "No")}");
                RetVal.AppendLine($"Network name      = {_SqlServer.NetName}");
                RetVal.AppendLine($"Collation         = {_SqlServer.Collation}");
                RetVal.AppendLine($"Service name      = {_SqlServer.ServiceName}");
                RetVal.AppendLine($"Startup account   = {_SqlServer.ServiceAccount}");
                RetVal.AppendLine($"SQL Root Path     = {_SqlServer.MasterDBPath}");
                RetVal.AppendLine($"Default log path  = {_SqlServer.MasterDBLogPath}");
                RetVal.AppendLine($"Error Log path    = {_SqlServer.ErrorLogPath}");
                RetVal.AppendLine($"Backup path       = {_SqlServer.BackupDirectory}");
                RetVal.AppendLine(MakeSectionFooter());

                RetVal.AppendLine(MakeSectionTitle($"Configuration"));
                foreach (ConfigProperty ConfigItem in _SqlServer.Configuration.Properties)
                {
                    RetVal.AppendLine($"{ConfigItem.DisplayName.AlignedLeft(40, '.')} = {ConfigItem.ConfigValue}");
                }
                RetVal.AppendLine(MakeSectionFooter());
                break;

                #endregion --- Full config --------------------------------------------

            default:
            case EDocumentConfigType.List:
                RetVal.AppendLine(TextBox.BuildHorizontalRowWithText($" Server version : {_SqlServer.VersionString} ", 120, TextBox.EHorizontalRowType.Single));
                break;
            }

            Output?.Invoke(RetVal.ToString());
        }
示例#2
0
 public abstract void DocumentConfig(EDocumentConfigType configType);