Error on unused private properties (#2008)

* Error on unused private properties

* Remove nullable

* Delete some commented out code

* Fix compile
This commit is contained in:
Charles Gagnon
2023-04-17 13:27:13 -07:00
committed by GitHub
parent efc8d8f0be
commit c15108808f
8 changed files with 399 additions and 988 deletions

View File

@@ -14,6 +14,11 @@ dotnet_diagnostic.IDE0073.severity = none
dotnet_analyzer_diagnostic.severity = error dotnet_analyzer_diagnostic.severity = error
# The private field 'field' is assigned but its value is never used
dotnet_diagnostic.CS0414.severity = error
# The private field 'class member' is never used
dotnet_diagnostic.CS0169.severity = error
# Errors flagged when this file was added. These should be # Errors flagged when this file was added. These should be
# investigated and either fixed or marked as acceptable with # investigated and either fixed or marked as acceptable with
# a reason why # a reason why

View File

@@ -23,7 +23,6 @@ namespace Microsoft.SqlTools.Extensibility
{ {
private ExtensibleServiceHostOptions options; private ExtensibleServiceHostOptions options;
private static bool isLoaded;
public ExtensionServiceProvider serviceProvider; public ExtensionServiceProvider serviceProvider;
private List<IHostedService> initializedServices = new List<IHostedService>(); private List<IHostedService> initializedServices = new List<IHostedService>();
@@ -39,8 +38,6 @@ namespace Microsoft.SqlTools.Extensibility
// as otherwise the Initialize event can be lost - it's processed and discarded before the handler // as otherwise the Initialize event can be lost - it's processed and discarded before the handler
// is hooked up to receive the message // is hooked up to receive the message
this.Start().GetAwaiter().GetResult(); this.Start().GetAwaiter().GetResult();
isLoaded = true;
} }
private void Initialize() private void Initialize()

View File

@@ -62,11 +62,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
/// </summary> /// </summary>
public static ConnectionService Instance => instance.Value; public static ConnectionService Instance => instance.Value;
/// <summary>
/// The authenticator instance for AAD MFA authentication needs.
/// </summary>
private IAuthenticator authenticator;
/// <summary> /// <summary>
/// IV and Key as received from Encryption Key Notification event. /// IV and Key as received from Encryption Key Notification event.
/// </summary> /// </summary>

View File

@@ -742,8 +742,6 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
private ShowPlanGraph graph; private ShowPlanGraph graph;
private Edge parentEdge; private Edge parentEdge;
private List<Edge> childrenEdges; private List<Edge> childrenEdges;
private string nodeType;
private Node root; private Node root;
/// <summary> /// <summary>

View File

@@ -118,8 +118,6 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
private string displayNameKey; private string displayNameKey;
private string descriptionKey; private string descriptionKey;
private string imageName; private string imageName;
private string helpKeyword;
private Type displayNodeType;
private string image; private string image;
private string displayName; private string displayName;

View File

@@ -37,14 +37,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Management
/// </summary> /// </summary>
private string contextUrn; private string contextUrn;
/// <summary> /// <summary>
/// Parent node in the tree
/// </summary>
//private INodeInformation parent;
/// <summary>
/// Weak reference to the tree node this is paired with
/// </summary>
WeakReference NavigableItemReference;
/// <summary>
/// Property handlers /// Property handlers
/// </summary> /// </summary>
//private IList<IPropertyHandler> propertyHandlers; //private IList<IPropertyHandler> propertyHandlers;
@@ -83,8 +75,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Management
this.name = name; this.name = name;
properties = new NameObjectCollection(); properties = new NameObjectCollection();
//propertyHandlers = null;
NavigableItemReference = null;
} }
#endregion #endregion

View File

@@ -24,8 +24,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
{ {
#region Members #region Members
private IServiceProvider serviceProvider = null;
/// <summary> /// <summary>
/// data container member that contains data specific information like /// data container member that contains data specific information like
/// connection infor, SMO server object or an AMO server object as well /// connection infor, SMO server object or an AMO server object as well
@@ -38,36 +36,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
//property by the initialization code //property by the initialization code
private ServerConnection serverConnection; private ServerConnection serverConnection;
/// <summary>
/// execution mode by default for now is success
/// </summary>
private ExecutionMode m_executionMode = ExecutionMode.Success;
/// <summary>
/// should UI be enabled?
/// </summary>
private bool executeEnabled = true;
/// <summary>
/// should script buttons be enabled?
/// </summary>
private bool scriptEnabled = true;
/// <summary>
/// F1 keyword to be passed to books on-line
/// </summary>
private string helpF1Keyword = null;
private RunType runType;
//if derived class tries to call a protected method that relies on service provider,
//and the service provider hasn't been set yet, we will cache the values and will
//propagate them when we get the provider set
private System.Drawing.Icon cachedIcon = null;
private string cachedCaption = null;
//whether or not try to auto resize grid columns inside OnLoad method
private bool attemtGridAutoResize = true;
#endregion #endregion
@@ -105,8 +73,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
#region Non-UI variables #region Non-UI variables
private System.Xml.XmlDocument document = null; private System.Xml.XmlDocument document = null;
private bool panelInitialized = false;
// info extracted from context // info extracted from context
private string serverName; private string serverName;
@@ -142,11 +108,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
public AppRoleGeneral(CDataContainer context) public AppRoleGeneral(CDataContainer context)
{ {
// STrace.SetDefaultLevel(ComponentName , SQLToolsCommonTraceLvl.L1);
// this.HelpF1Keyword = AssemblyVersionInfo.VersionHelpKeywordPrefix + @".swb.approle.general.f1";
// InitializeComponent();
dataContainer = context; dataContainer = context;
if (dataContainer != null) if (dataContainer != null)
@@ -398,226 +359,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
} }
#endregion #endregion
// #region Update UI enable/disable controls
// private void EnableDisableControls()
// {
// if (!this.isYukonOrLater)
// {
// panelSchema.Enabled = false;
// textBoxDefaultSchema.Enabled = false;
// buttonBrowseSchema.Enabled = false;
// }
// if (this.IsPropertiesMode == true)
// {
// System.Diagnostics.Debug.Assert(!string.IsNullOrWhiteSpace(this.textBoxRoleName.Text), "textBoxRoleName is empty");
// this.textBoxRoleName.Enabled = false;
// this.AllUIEnabled = true;
// }
// else
// {
// this.textBoxRoleName.Enabled = true;
// this.AllUIEnabled = (this.textBoxRoleName.Text.Trim().Length != 0);
// }
// if ((passwordChanged==true) && (textBoxPasword.Text != textBoxConfirmPassword.Text))
// {
// this.AllUIEnabled = false;
// }
// buttonRemove.Enabled = (gridRoleMembership.SelectedRow>=0);
// panelMembership.Enabled = false; // app role currently doesnt support any members
// }
// #endregion
// #region Component Designer generated code
// /// <summary>
// /// Required method for Designer support - do not modify
// /// the contents of this method with the code editor.
// /// </summary>
// private void InitializeComponent()
// {
// System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AppRoleGeneral));
// this.panelEntireUserControl = new System.Windows.Forms.Panel();
// this.panelGeneral = new System.Windows.Forms.Panel();
// this.buttonBrowseSchema = new System.Windows.Forms.Button();
// this.textBoxDefaultSchema = new System.Windows.Forms.TextBox();
// this.textBoxPasword = new System.Windows.Forms.TextBox();
// this.labelPassword = new System.Windows.Forms.Label();
// this.labelDefaultSchema = new System.Windows.Forms.Label();
// this.textBoxRoleName = new System.Windows.Forms.TextBox();
// this.labelRoleName = new System.Windows.Forms.Label();
// this.textBoxConfirmPassword = new System.Windows.Forms.TextBox();
// this.labelConfirmPassword = new System.Windows.Forms.Label();
// this.panelMembership = new System.Windows.Forms.Panel();
// this.buttonRemove = new System.Windows.Forms.Button();
// this.buttonAdd = new System.Windows.Forms.Button();
// this.gridRoleMembership = new Microsoft.SqlServer.Management.SqlManagerUI.SqlManagerUIDlgGrid();
// this.labelMembersOfAppRole = new System.Windows.Forms.Label();
// this.panelSchema = new System.Windows.Forms.Panel();
// this.gridSchemasOwned = new Microsoft.SqlServer.Management.SqlManagerUI.SqlManagerUIDlgGrid();
// this.labelSchemasOwnedByAppRole = new System.Windows.Forms.Label();
// this.panelEntireUserControl.SuspendLayout();
// this.panelGeneral.SuspendLayout();
// this.panelMembership.SuspendLayout();
// ((System.ComponentModel.ISupportInitialize)(this.gridRoleMembership)).BeginInit();
// this.panelSchema.SuspendLayout();
// ((System.ComponentModel.ISupportInitialize)(this.gridSchemasOwned)).BeginInit();
// this.SuspendLayout();
// this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
// this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
// //
// // panelEntireUserControl
// // Important: For narrator accessibility please make sure all Controls.Add are in order from top to bottom, left to right
// //
// this.panelEntireUserControl.Controls.Add(this.panelGeneral);
// this.panelEntireUserControl.Controls.Add(this.panelMembership);
// this.panelEntireUserControl.Controls.Add(this.panelSchema);
// resources.ApplyResources(this.panelEntireUserControl, "panelEntireUserControl");
// this.panelEntireUserControl.Name = "panelEntireUserControl";
// //
// // panelGeneral
// // Important: For narrator accessibility please make sure all Controls.Add are in order from top to bottom, left to right
// //
// resources.ApplyResources(this.panelGeneral, "panelGeneral");
// this.panelGeneral.Controls.Add(this.labelRoleName);
// this.panelGeneral.Controls.Add(this.textBoxRoleName);
// this.panelGeneral.Controls.Add(this.labelDefaultSchema);
// this.panelGeneral.Controls.Add(this.textBoxDefaultSchema);
// this.panelGeneral.Controls.Add(this.buttonBrowseSchema);
// this.panelGeneral.Controls.Add(this.labelPassword);
// this.panelGeneral.Controls.Add(this.textBoxPasword);
// this.panelGeneral.Controls.Add(this.labelConfirmPassword);
// this.panelGeneral.Controls.Add(this.textBoxConfirmPassword);
// this.panelGeneral.Name = "panelGeneral";
// //
// // buttonBrowseSchema
// //
// resources.ApplyResources(this.buttonBrowseSchema, "buttonBrowseSchema");
// this.buttonBrowseSchema.Name = "buttonBrowseSchema";
// this.buttonBrowseSchema.Click += new System.EventHandler(this.buttonBrowseSchema_Click);
// //
// // textBoxDefaultSchema
// //
// resources.ApplyResources(this.textBoxDefaultSchema, "textBoxDefaultSchema");
// this.textBoxDefaultSchema.Name = "textBoxDefaultSchema";
// this.textBoxDefaultSchema.TextChanged += new System.EventHandler(this.textBoxRoleName_TextChanged);
// //
// // textBoxPasword
// //
// resources.ApplyResources(this.textBoxPasword, "textBoxPasword");
// this.textBoxPasword.Name = "textBoxPasword";
// this.textBoxPasword.TextChanged += new System.EventHandler(this.textBoxPasword_TextChanged);
// //
// // labelPassword
// //
// resources.ApplyResources(this.labelPassword, "labelPassword");
// this.labelPassword.Name = "labelPassword";
// //
// // labelDefaultSchema
// //
// resources.ApplyResources(this.labelDefaultSchema, "labelDefaultSchema");
// this.labelDefaultSchema.Name = "labelDefaultSchema";
// //
// // textBoxRoleName
// //
// resources.ApplyResources(this.textBoxRoleName, "textBoxRoleName");
// this.textBoxRoleName.Name = "textBoxRoleName";
// this.textBoxRoleName.TextChanged += new System.EventHandler(this.textBoxRoleName_TextChanged);
// //
// // labelRoleName
// //
// resources.ApplyResources(this.labelRoleName, "labelRoleName");
// this.labelRoleName.Name = "labelRoleName";
// //
// // textBoxConfirmPassword
// //
// resources.ApplyResources(this.textBoxConfirmPassword, "textBoxConfirmPassword");
// this.textBoxConfirmPassword.Name = "textBoxConfirmPassword";
// this.textBoxConfirmPassword.TextChanged += new System.EventHandler(this.textBoxConfirmPassword_TextChanged);
// //
// // labelConfirmPassword
// //
// resources.ApplyResources(this.labelConfirmPassword, "labelConfirmPassword");
// this.labelConfirmPassword.Name = "labelConfirmPassword";
// //
// // panelMembership
// // Important: For narrator accessibility please make sure all Controls.Add are in order from top to bottom, left to right
// //
// resources.ApplyResources(this.panelMembership, "panelMembership");
// this.panelMembership.Controls.Add(this.labelMembersOfAppRole);
// this.panelMembership.Controls.Add(this.gridRoleMembership);
// this.panelMembership.Controls.Add(this.buttonAdd);
// this.panelMembership.Controls.Add(this.buttonRemove);
// this.panelMembership.Name = "panelMembership";
// //
// // buttonRemove
// //
// resources.ApplyResources(this.buttonRemove, "buttonRemove");
// this.buttonRemove.Name = "buttonRemove";
// this.buttonRemove.Click += new System.EventHandler(this.buttonRemove_Click);
// //
// // buttonAdd
// //
// resources.ApplyResources(this.buttonAdd, "buttonAdd");
// this.buttonAdd.Name = "buttonAdd";
// this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click);
// //
// // gridRoleMembership
// //
// resources.ApplyResources(this.gridRoleMembership, "gridRoleMembership");
// this.gridRoleMembership.BackColor = System.Drawing.SystemColors.Window;
// this.gridRoleMembership.ForceEnabled = false;
// this.gridRoleMembership.Name = "gridRoleMembership";
// this.gridRoleMembership.SelectionChanged += new Microsoft.SqlServer.Management.UI.Grid.SelectionChangedEventHandler(this.gridRoleMembership_SelectionChanged);
// //
// // labelMembersOfAppRole
// //
// resources.ApplyResources(this.labelMembersOfAppRole, "labelMembersOfAppRole");
// this.labelMembersOfAppRole.Name = "labelMembersOfAppRole";
// //
// // panelSchema
// // Important: For narrator accessibility please make sure all Controls.Add are in order from top to bottom, left to right
// //
// resources.ApplyResources(this.panelSchema, "panelSchema");
// this.panelSchema.Controls.Add(this.labelSchemasOwnedByAppRole);
// this.panelSchema.Controls.Add(this.gridSchemasOwned);
// this.panelSchema.Name = "panelSchema";
// //
// // gridSchemasOwned
// //
// resources.ApplyResources(this.gridSchemasOwned, "gridSchemasOwned");
// this.gridSchemasOwned.BackColor = System.Drawing.SystemColors.Window;
// this.gridSchemasOwned.ForceEnabled = false;
// this.gridSchemasOwned.Name = "gridSchemasOwned";
// this.gridSchemasOwned.MouseButtonClicked += new Microsoft.SqlServer.Management.UI.Grid.MouseButtonClickedEventHandler(this.gridSchemasOwned_MouseButtonClicked);
// //
// // labelSchemasOwnedByAppRole
// //
// resources.ApplyResources(this.labelSchemasOwnedByAppRole, "labelSchemasOwnedByAppRole");
// this.labelSchemasOwnedByAppRole.Name = "labelSchemasOwnedByAppRole";
// //
// // AppRoleGeneral
// //
// this.Controls.Add(this.panelEntireUserControl);
// this.Name = "AppRoleGeneral";
// resources.ApplyResources(this, "$this");
// this.panelEntireUserControl.ResumeLayout(false);
// this.panelGeneral.ResumeLayout(false);
// this.panelGeneral.PerformLayout();
// this.panelMembership.ResumeLayout(false);
// ((System.ComponentModel.ISupportInitialize)(this.gridRoleMembership)).EndInit();
// this.panelSchema.ResumeLayout(false);
// ((System.ComponentModel.ISupportInitialize)(this.gridSchemasOwned)).EndInit();
// this.ResumeLayout(false);
// }
// #endregion
#region Schemas - general operations with ... #region Schemas - general operations with ...
HybridDictionary dictSchemas = null; HybridDictionary dictSchemas = null;
StringCollection schemaNames = null; StringCollection schemaNames = null;
@@ -651,82 +392,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
} }
} }
/// <summary>
/// initializes the columns and headers of schema grid - but doesnt populate grid with any data
/// </summary>
// private void InitializeSchemasGridColumns()
// {
// Microsoft.SqlServer.Management.UI.Grid.DlgGridControl grid = this.gridSchemasOwned;
// if (grid.RowsNumber != 0)
// {
// grid.DeleteAllRows();
// }
// while (grid.ColumnsNumber != 0)
// {
// grid.DeleteColumn(0);
// }
// GridColumnInfo colInfo = null;
// // checkbox owned/not-owned
// colInfo = new GridColumnInfo();
// colInfo.ColumnWidth = sizeCheckboxColumn;
// colInfo.WidthType = GridColumnWidthType.InPixels;
// colInfo.ColumnType = GridColumnType.Checkbox;
// grid.AddColumn(colInfo);
// // schema name
// colInfo = new GridColumnInfo();
// colInfo.ColumnWidth = grid.Width - sizeCheckboxColumn - 2;
// colInfo.WidthType = GridColumnWidthType.InPixels;
// grid.AddColumn(colInfo);
// grid.SetHeaderInfo(colSchemasOwnedSchemas, AppRoleSR.HeaderOwnedSchemas, null);
// grid.SelectionType = GridSelectionType.SingleRow;
// grid.UpdateGrid();
// }
// private void FillSchemasGrid()
// {
// if (this.isYukonOrLater)
// {
// Microsoft.SqlServer.Management.UI.Grid.DlgGridControl grid = this.gridSchemasOwned;
// grid.DeleteAllRows();
// foreach (string schemaName in this.schemaNames)
// {
// GridCellCollection row = new GridCellCollection();
// GridCell cell = null;
// STrace.Assert(!string.IsNullOrWhiteSpace(schemaName), "schemaName is empty");
// string owner = this.dictSchemas[schemaName].ToString();
// STrace.Assert(!string.IsNullOrWhiteSpace(owner), "owner is empty");
// bool owned = IsPropertiesMode ? (0 == String.Compare(owner, approleName, StringComparison.Ordinal)) : false;
// // grid is filled either
// // a) disabled-checked checkboxes: Indeterminate - if already owning schema - we cannot renounce ownership
// // b) enabled-unchecked checkboxes: Unchecked - user can check / uncheck them and we read final state
// cell = new GridCell(owned ? GridCheckBoxState.Indeterminate : GridCheckBoxState.Unchecked); row.Add(cell);
// cell = new GridCell(schemaName); row.Add(cell);
// grid.AddRow(row);
// }
// if (grid.RowsNumber > 0)
// {
// grid.SelectedRow = 0;
// }
// }
// }
/// <summary> /// <summary>
/// sends to server changes related to schema ownership /// sends to server changes related to schema ownership
/// </summary> /// </summary>
@@ -973,210 +638,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
return false; return false;
} }
// private void gridRoleMembership_SelectionChanged(object sender, Microsoft.SqlServer.Management.UI.Grid.SelectionChangedEventArgs args)
// {
// EnableDisableControls();
// }
// private void buttonAdd_Click(object sender, System.EventArgs e)
// {
// DlgGridControl grid = this.gridRoleMembership;
// using (SqlObjectSearch dlg = new SqlObjectSearch(this.Font,
// iconSearchUsers,
// this.HelpProvider,
// AppRoleSR.SearchUsers,
// this.DataContainer.ConnectionInfo,
// this.databaseName,
// new SearchableObjectTypeCollection(SearchableObjectType.User),
// new SearchableObjectTypeCollection(SearchableObjectType.User)))
// {
// DialogResult dr = dlg.ShowDialog(this.FindForm());
// if (dr == DialogResult.OK)
// {
// foreach (SearchableObject principal in dlg.SearchResults)
// {
// grid = this.gridRoleMembership;
// GridCellCollection row = new GridCellCollection();
// GridCell cell = null;
// string name = principal.Name;
// cell = new GridCell(bitmapMember); row.Add(cell); // compute type based on urn
// cell = new GridCell(name); row.Add(cell);
// // row.Tag = urn == de.Value.ToString();
// grid.AddRow(row);
// }
// if (grid.RowsNumber > 0)
// {
// grid.SelectedRow = grid.RowsNumber-1;
// }
// }
// }
// }
// private void buttonRemove_Click(object sender, System.EventArgs e)
// {
// DlgGridControl grid = this.gridRoleMembership;
// int rowNo = grid.SelectedRow;
// System.Diagnostics.Debug.Assert(rowNo >= 0, "Invalid selected row");
// if (rowNo >= 0)
// {
// grid.DeleteRow(rowNo);
// }
// }
#endregion #endregion
// #region Bitmaps and Icons
// private Bitmap bitmapMember = null;
// private Icon iconSearchUsers = null;
// private Icon iconSchema = null;
// /// <summary>
// /// initialize bitmaps used for membership grid
// /// </summary>
// private void InitializeBitmapAndIcons()
// {
// CUtils utils = new CUtils();
// bitmapMember = utils.LoadIcon("member.ico").ToBitmap();
// iconSearchUsers = utils.LoadIcon("search_users_roles.ico");
// iconSchema = utils.LoadIcon("database_schema.ico");
// }
// #endregion
// #region General Grid operations - helpers
// /// <summary>
// /// gets status of checkbox
// /// </summary>
// /// <param name="grid"></param>
// /// <param name="rowno"></param>
// /// <param name="colno"></param>
// /// <returns></returns>
// bool IsEmbeededCheckboxChecked(DlgGridControl grid, int rowno, int colno)
// {
// // get the storage for the cell
// GridCell cell = grid.GetCellInfo(rowno, colno);
// GridCheckBoxState state = (GridCheckBoxState) cell.CellData;
// return(state == GridCheckBoxState.Checked);
// }
// /// <summary>
// /// flips on/off checkboxes from grid
// /// </summary>
// /// <param name="rowsno"></param>
// /// <param name="colno"></param>
// void FlipCheckbox(DlgGridControl grid, int rowno, int colno)
// {
// // get the storage for the cell
// GridCell cell = grid.GetCellInfo(rowno, colno);
// GridCheckBoxState state = (GridCheckBoxState) cell.CellData;
// // explicitly invert the cell state
// switch (state)
// {
// case GridCheckBoxState.Checked:
// cell.CellData = GridCheckBoxState.Unchecked;
// break;
// case GridCheckBoxState.Unchecked:
// cell.CellData = GridCheckBoxState.Checked;
// break;
// case GridCheckBoxState.Indeterminate:
// // do nothing if Indeterminate - this means that entry is checked and r/o (e.g. schemas already owned)
// break;
// case GridCheckBoxState.None:
// break;
// default:
// System.Diagnostics.Debug.Assert(false,"unknown checkbox state");
// break;
// }
// }
// #endregion
// #region Non-Grid related Events
// private void textBoxRoleName_TextChanged(object sender, System.EventArgs e)
// {
// EnableDisableControls();
// }
// bool passwordChanged = false;
// private void textBoxPasword_TextChanged(object sender, System.EventArgs e)
// {
// passwordChanged = true;
// EnableDisableControls();
// }
// private void textBoxConfirmPassword_TextChanged(object sender, System.EventArgs e)
// {
// passwordChanged = true;
// EnableDisableControls();
// }
// #endregion
// #region ISupportValidation Members
// bool ISupportValidation.Validate()
// {
// if (this.textBoxRoleName.Text.Trim().Length == 0)
// {
// System.Exception e = new System.Exception(AppRoleSR.ErrorApplicationRoleNameMustBeSpecified);
// this.DisplayExceptionMessage(e);
// return false;
// }
// if (this.textBoxPasword.Text.Trim().Length == 0)
// {
// System.Exception e = new System.Exception(AppRoleSR.ErrorPasswordIsBlank);
// this.DisplayExceptionMessage(e);
// return false;
// }
// if (this.textBoxPasword.Text != this.textBoxConfirmPassword.Text)
// {
// System.Exception e = new System.Exception(AppRoleSR.ErrorPasswordMismatch);
// this.DisplayExceptionMessage(e);
// return false;
// }
// return true;
// }
// #endregion
// private void buttonBrowseSchema_Click(object sender, System.EventArgs e)
// {
// //
// // pop up object picker
// //
// using (SqlObjectSearch dlg = new SqlObjectSearch(this.Font,
// this.iconSchema,
// this.HelpProvider,
// AppRoleSR.BrowseSchemaTitle,
// this.DataContainer.ConnectionInfo,
// this.databaseName,
// new SearchableObjectTypeCollection(SearchableObjectType.Schema),
// new SearchableObjectTypeCollection(SearchableObjectType.Schema)))
// {
// if (DialogResult.OK == dlg.ShowDialog(this.FindForm()))
// {
// this.textBoxDefaultSchema.Text = dlg.SearchResults[0].Name;
// }
// }
// }
} }
} }

View File

@@ -24,9 +24,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
internal class DatabaseRoleGeneral internal class DatabaseRoleGeneral
{ {
#region Members #region Members
private IServiceProvider serviceProvider = null;
/// <summary> /// <summary>
/// data container member that contains data specific information like /// data container member that contains data specific information like
/// connection infor, SMO server object or an AMO server object as well /// connection infor, SMO server object or an AMO server object as well
@@ -39,36 +36,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
//property by the initialization code //property by the initialization code
private ServerConnection serverConnection; private ServerConnection serverConnection;
/// <summary>
/// execution mode by default for now is success
/// </summary>
private ExecutionMode m_executionMode = ExecutionMode.Success;
/// <summary>
/// should UI be enabled?
/// </summary>
private bool executeEnabled = true;
/// <summary>
/// should script buttons be enabled?
/// </summary>
private bool scriptEnabled = true;
/// <summary>
/// F1 keyword to be passed to books on-line
/// </summary>
private string helpF1Keyword = null;
private RunType runType;
//if derived class tries to call a protected method that relies on service provider,
//and the service provider hasn't been set yet, we will cache the values and will
//propagate them when we get the provider set
private System.Drawing.Icon cachedIcon = null;
private string cachedCaption = null;
//whether or not try to auto resize grid columns inside OnLoad method
private bool attemtGridAutoResize = true;
#endregion #endregion
#region Trace support #region Trace support
@@ -136,7 +103,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
#region Non-UI variables #region Non-UI variables
private System.Xml.XmlDocument document = null; private System.Xml.XmlDocument document = null;
private bool panelInitialized = false;
// info extracted from context // info extracted from context
private string serverName; private string serverName;