Address error IDE0270 after MsBuild update (#1865)

This commit is contained in:
Cheena Malhotra
2023-02-16 16:15:30 -08:00
committed by GitHub
parent 0f82062502
commit 74dd15c868
14 changed files with 27 additions and 106 deletions

View File

@@ -756,20 +756,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
private static IEnumerable GetAttributeCollectionForChoiceElement(PropertyDescriptor property)
{
Type type = property.ComponentType;
PropertyInfo pInfo = type.GetProperty("Items");
if (pInfo == null)
{
//Try using item.
pInfo = type.GetProperty("Item");
}
if (pInfo != null)
{
return pInfo.GetCustomAttributes(true);
}
return property.Attributes;
PropertyInfo pInfo = type.GetProperty("Items") ?? type.GetProperty("Item");
return pInfo != null ? pInfo.GetCustomAttributes(true) : property.Attributes;
}
public static PropertyDescriptor CreateProperty(string propertyName, object value)
{

View File

@@ -384,12 +384,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
nsMgr.AddNamespace("shp", "http://schemas.microsoft.com/sqlserver/2004/07/showplan");
//The root node in this case is the statement node
XmlNode rootNode = stmtXmlDocument.DocumentElement;
if(rootNode == null)
{
//Couldn't find our statement node, this should never happen in a properly formed document
throw new ArgumentNullException("StatementNode");
}
//If couldn't find our statement node, throw exception, as this should never happen in a properly formed document
XmlNode rootNode = stmtXmlDocument.DocumentElement ?? throw new ArgumentNullException("StatementNode");
XmlNode missingIndexes = rootNode.SelectSingleNode("descendant::shp:MissingIndexes", nsMgr);