Skip to content

Commit

Permalink
Update Reference Sources to .NET Framework 4.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnet-bot authored and richlander committed May 15, 2018
1 parent b31308b commit 3b1eaf5
Show file tree
Hide file tree
Showing 213 changed files with 6,338 additions and 2,356 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ protected override void OnModelItemChanged(object newItem)

protected internal override string GetAutomationItemStatus()
{
if (!LocalAppContextSwitches.UseLegacyAccessibilityFeatures2)
{
return String.Empty;
}
string status = base.GetAutomationItemStatus();
status = status + "Guid=" + this.guid.ToString() + " ";
status = status + "IsFinal=" + (this.IsFinalState() ? "True " : "False ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ public ConnectorAutomationPeer(FrameworkElement owner, AutomationPeer wrappedAut

protected override string GetItemStatusCore()
{
if (!LocalAppContextSwitches.UseLegacyAccessibilityFeatures2)
{
return String.Empty;
}
UIElement sourceDesigner = VirtualizedContainerService.TryGetVirtualizedElement(FreeFormPanel.GetSourceConnectionPoint(this.Owner).ParentDesigner);
string sourceId = sourceDesigner.GetValue(AutomationProperties.ItemStatusProperty) as string;
UIElement destinationDesigner = VirtualizedContainerService.TryGetVirtualizedElement(FreeFormPanel.GetDestinationConnectionPoint(this.Owner).ParentDesigner);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,17 @@ public string Text

[SuppressMessage(FxCop.Category.Design, "CA1044:PropertiesShouldNotBeWriteOnly",
Justification = "The host just sets this property for the designer to know which colors to display.")]
[SuppressMessage("Microsoft.Security.Xml", "CA3053:UseXmlSecureResolver",
Justification = @"For the call to XmlReader.Create() below, CA3053 recommends setting the
XmlReaderSettings.XmlResolver property to either null or an instance of XmlSecureResolver.
But after setting this property to null, a warning of CA3053 still shows up in FxCop.
So we suppress this error until the reporting for CA3053 has been updated to fix this issue.")]
public string PropertyInspectorFontAndColorData
{
set
{
StringReader stringReader = new StringReader(value);
XmlReader xmlReader = XmlReader.Create(stringReader);
XmlReader xmlReader = XmlReader.Create(stringReader, new XmlReaderSettings { XmlResolver = null });
Hashtable fontAndColorDictionary = (Hashtable)System.Windows.Markup.XamlReader.Load(xmlReader);
foreach (string key in fontAndColorDictionary.Keys)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public static class WorkflowDesignerColors
public const string WorkflowViewElementBackgroundColorKey = "WorkflowViewElementBackgroundColorKey";
public const string WorkflowViewElementSelectedBackgroundColorKey = "WorkflowViewElementSelectedBackgroundColorKey";
public const string WorkflowViewElementSelectedBorderColorKey = "WorkflowViewElementSelectedBorderColorKey";
public const string WorkflowViewElementSelectedCaptionColorKey = "WorkflowViewElementSelectedCaptionBrushColorKey";
public const string DesignerViewStatusBarBackgroundColorKey = "DesignerViewStatusBarBackgroundColorKey";
public const string WorkflowViewElementCaptionColorKey = "WorkflowViewElementCaptionBrushColorKey";
public const string DesignerViewBackgroundColorKey = "DesignerViewBackgroundColorKey";
Expand Down Expand Up @@ -68,14 +69,12 @@ public static class WorkflowDesignerColors
public static string PropertyInspectorToolBarBackgroundBrushKey { get { return PropertyInspectorMergedResources.ToolBarBackgroundBrushKey; } }
public static string PropertyInspectorToolBarSeparatorBrushKey { get { return PropertyInspectorMergedResources.ToolBarSeparatorBrushKey; } }
public static string PropertyInspectorToolBarTextBoxBorderBrushKey { get { return PropertyInspectorMergedResources.ToolBarTextBoxBorderBrushKey; } }



public const string FlowchartExpressionButtonColorKey = "FlowchartExpressionButtonColorKey";
public const string FlowchartExpressionButtonMouseOverColorKey = "FlowchartExpressionButtonMouseOverColorKey";
public const string FlowchartExpressionButtonPressedColorKey = "FlowchartExpressionButtonPressedColorKey";

public const string FlowchartConnectorColorKey = "FlowchartConnectorColorKey";


public const string AnnotationBackgroundGradientBeginColorKey = "AnnotationBackgroundGradientBeginColorKey";
public const string AnnotationBackgroundGradientMiddleColorKey = "AnnotationBackgroundGradientMiddleColorKey";
public const string AnnotationBackgroundGradientEndColorKey = "AnnotationBackgroundGradientEndColorKey";
Expand All @@ -102,7 +101,9 @@ public static class WorkflowDesignerColors
public static readonly string FontFamilyKey = CreateKey("FontFamilyKey");
public static readonly string FontWeightKey = CreateKey("FontWeightKey");


public const string PropertyToolBarHightlightedButtonForegroundColorKey = "PropertyToolBarHightlightedButtonForegroundColor";
public const string ActivityDesignerSelectedTitleForegroundColorKey = "ActivityDesignerSelectedTitleForegroundColorKey";

static ResourceDictionary DefaultColors
{
get
Expand Down Expand Up @@ -240,15 +241,15 @@ public static Color WorkflowViewElementCaptionColor
return GetColor(WorkflowDesignerColors.WorkflowViewElementCaptionColorKey);
}
}
internal static Color WorkflowViewElementSelectedCaptionColor
public static Color WorkflowViewElementSelectedCaptionColor
{
get
{
if (LocalAppContextSwitches.UseLegacyAccessibilityFeatures)
{
return WorkflowViewElementCaptionColor;
}
return GetColor(WorkflowDesignerColorsInternal.WorkflowViewElementSelectedCaptionColorKey);
return GetColor(WorkflowDesignerColors.WorkflowViewElementSelectedCaptionColorKey);
}
}
public static Color DesignerViewBackgroundColor
Expand Down Expand Up @@ -319,20 +320,20 @@ public static Brush DesignerViewExpandAllCollapseAllPressedBrush
get { return GetBrush(WorkflowDesignerColors.DesignerViewExpandAllCollapseAllPressedColorKey); }
}

internal static Color PropertyToolBarHightlightedButtonForegroundColor
public static Color PropertyToolBarHightlightedButtonForegroundColor
{
get
{
if (LocalAppContextSwitches.UseLegacyAccessibilityFeatures)
{
return Colors.Black;
}
return GetColor(WorkflowDesignerColorsInternal.PropertyToolBarHightlightedButtonForegroundColorKey);
return GetColor(WorkflowDesignerColors.PropertyToolBarHightlightedButtonForegroundColorKey);
}
}
internal static Color ActivityDesignerSelectedTitleForegroundColor
public static Color ActivityDesignerSelectedTitleForegroundColor
{
get { return GetColor(WorkflowDesignerColorsInternal.ActivityDesignerSelectedTitleForegroundColorKey); }
get { return GetColor(WorkflowDesignerColors.ActivityDesignerSelectedTitleForegroundColorKey); }
}
public static Color ContextMenuBackgroundGradientBeginColor
{
Expand Down Expand Up @@ -388,7 +389,7 @@ public static Color ContextMenuItemTextHoverColor
get { return GetColor(WorkflowDesignerColors.ContextMenuItemTextHoverColorKey); }
}

internal static Color ContextMenuItemTextHoverQuirkedColor
public static Color ContextMenuItemTextHoverQuirkedColor
{
get
{
Expand All @@ -415,15 +416,15 @@ public static Color ContextMenuSeparatorColor
get { return GetColor(WorkflowDesignerColors.ContextMenuSeparatorColorKey); }
}

internal static Color FlowchartConnectorColor
public static Color FlowchartConnectorColor
{
get
{
if (LocalAppContextSwitches.UseLegacyAccessibilityFeatures)
{
return WorkflowViewElementBorderColor;
}
return GetColor(WorkflowDesignerColorsInternal.FlowchartConnectorColorKey);
return GetColor(WorkflowDesignerColors.FlowchartConnectorColorKey);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ static void OnAssemblyLoaded(object sender, AssemblyLoadEventArgs args)

if (assembly.IsDefined(typeof(XmlnsDefinitionAttribute), false) && !assembly.IsDynamic)
{
lock (XmlnsMappingsLockObject)
{
CacheLoadedAssembly(assembly);
}
// Don't lock XmlnsMappingsLockObject here. Leave it up to CacheLoadedAssembly to do it. If we
// do it here, we could get a deadlock because the GetCustomAttribute in CacheLoadedAssembly might
// induce another attempt to load an assembly whose "load lock" is already held by another thread
// that may end up waiting for this XmlnsMappingsLockObject. (DevDiv 251926)
CacheLoadedAssembly(assembly);
}
}

Expand Down Expand Up @@ -265,26 +266,38 @@ static void CacheLoadedAssembly(Assembly assembly)
string assemblyName = assembly.FullName;
XmlnsMapping mapping;

for (int i = 0; i < attributes.Length; ++i)
// Obtain the lock that is protecting the xmlnsMappings dictionary because we are going
// to access it and potentially modify it here. Do the lock here, rather than requiring
// the caller to do it because GetCustomAttributes may end up triggering another
// assembly load during OnAssemblyLoaded processing, which could cause a deadlock with
// a lock used when loading an assembly that is out of our control. One caller - EnsureInitialized -
// will get the lock before calling this. But that's okay because locking again on the same thread
// works. (DevDiv 251926)
// Note that CollectXmlNamespacesAndAssemblies also does this lock because it calls
// WrapCachedMapping, which also access and potentially modifieds the xmlnsMapping dictionary.
lock (XmlnsMappingsLockObject)
{
XNamespace xmlns = XNamespace.Get(attributes[i].XmlNamespace);

if (!xmlnsMappings.TryGetValue(xmlns, out mapping))
for (int i = 0; i < attributes.Length; ++i)
{
mapping.ImportReferences = new HashSet<VisualBasicImportReference>();
xmlnsMappings[xmlns] = mapping;
}
XNamespace xmlns = XNamespace.Get(attributes[i].XmlNamespace);

VisualBasicImportReference newImportReference = new VisualBasicImportReference
{
Assembly = assemblyName,
Import = attributes[i].ClrNamespace,
Xmlns = xmlns,
};
// early binding the assembly
// this leads to the short-cut, skipping the normal assembly resolution routine
newImportReference.EarlyBoundAssembly = assembly;
mapping.ImportReferences.Add(newImportReference);
if (!xmlnsMappings.TryGetValue(xmlns, out mapping))
{
mapping.ImportReferences = new HashSet<VisualBasicImportReference>();
xmlnsMappings[xmlns] = mapping;
}

VisualBasicImportReference newImportReference = new VisualBasicImportReference
{
Assembly = assemblyName,
Import = attributes[i].ClrNamespace,
Xmlns = xmlns,
};
// early binding the assembly
// this leads to the short-cut, skipping the normal assembly resolution routine
newImportReference.EarlyBoundAssembly = assembly;
mapping.ImportReferences.Add(newImportReference);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace System.Activities.Debugger
{
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Xml;

Expand All @@ -18,11 +19,16 @@ internal class XmlReaderWithSourceLocation : XmlWrappingReader
private CharacterSpottingTextReader characterSpottingTextReader;
private Stack<DocumentLocation> contentStartLocationStack;

[SuppressMessage("Microsoft.Security.Xml", "CA3053:UseXmlSecureResolver",
Justification = @"For the call to XmlReader.Create() below, CA3053 recommends setting the
XmlReaderSettings.XmlResolver property to either null or an instance of XmlSecureResolver.
But after setting this property to null, a warning of CA3053 still shows up in FxCop.
So we suppress this error until the reporting for CA3053 has been updated to fix this issue.")]
public XmlReaderWithSourceLocation(TextReader underlyingTextReader)
{
UnitTestUtility.Assert(underlyingTextReader != null, "CharacterSpottingTextReader cannot be null and should be ensured by caller.");
CharacterSpottingTextReader characterSpottingTextReader = new CharacterSpottingTextReader(underlyingTextReader);
this.BaseReader = XmlReader.Create(characterSpottingTextReader);
this.BaseReader = XmlReader.Create(characterSpottingTextReader, new XmlReaderSettings { XmlResolver = null });
UnitTestUtility.Assert(this.BaseReaderAsLineInfo != null, "The XmlReader created by XmlReader.Create should ensure this.");
UnitTestUtility.Assert(this.BaseReaderAsLineInfo.HasLineInfo(), "The XmlReader created by XmlReader.Create should ensure this.");
this.characterSpottingTextReader = characterSpottingTextReader;
Expand Down
Loading

0 comments on commit 3b1eaf5

Please sign in to comment.