Skip to content

Commit

Permalink
Update Reference Source to .NET 4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnet-bot authored and richlander committed Apr 12, 2017
1 parent cf5e702 commit 4251daa
Show file tree
Hide file tree
Showing 3,092 changed files with 197,924 additions and 8,312 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion System.Activities.Core.Presentation/SR.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal static Argument MorphArgument(ModelItem originalValue, Type targetType)
{
morphed.Expression = morphedExpression;
}
//[....]
//Microsoft

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ internal void ValidateEntry(DynamicArgumentWrapperObject entry, DependencyProper
}
else
{
//[....]
//Microsoft

entry.Expression = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static void StartCommandCallback(object state)
SqlCommandAsyncResult thisPtr = (SqlCommandAsyncResult) state;
try
{
// this can throw on the [....] path - we need to signal the callback
// this can throw on the sync path - we need to signal the callback
thisPtr.StartCommandInternal(false);
}
catch (Exception e)
Expand Down Expand Up @@ -171,7 +171,7 @@ bool CompleteExecuteReader(IAsyncResult result)
this.sqlCommand.Connection.Close();
}

// If we completed [....] then any retry is done by the original caller.
// If we completed sync then any retry is done by the original caller.
if (!result.CompletedSynchronously)
{
if (this.CheckRetryCountAndTimer() && ShouldRetryForSqlError(exception.Number, RetryErrorOptions.RetryOnEnd))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChanged

if (hasKeyboardFocus)
{
// We just gained keyboard focus. Make sure we [....] up the current property selection
// We just gained keyboard focus. Make sure we sync up the current property selection
// with the keyboard focus, so that navigation works.
SynchronizeSelectionFocus(StealFocusMode.OnlyIfCurrentSelectionDoesNotHaveFocusWithin);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ private void OnFinishEditing()

private void ItemsSourceChanged()
{
// The collection just changed, so we need to make sure that things are in [....]
// The collection just changed, so we need to make sure that things are in sync

// ###################################################
// CIDER-SPECIFIC CHANGE IN NEED OF PORTING - BEGIN
Expand Down Expand Up @@ -1131,7 +1131,7 @@ protected bool UpdateValueFromInternalValues()

this.Value = newValue;

// At this point it is possible that the value that we just set is out of [....] with the internal value
// At this point it is possible that the value that we just set is out of sync with the internal value
if (newValue != this.InternalValue)
{
this.UpdateInternalValuesFromValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace System.Activities.Presentation.Internal.PropertyEditing
using Microsoft.Win32;

// <summary>
// Helper class that is responsible for opening a [....] Form that hosts the WPF
// Helper class that is responsible for opening a Microsoft Form that hosts the WPF
// PropertyValueDialogControl that ultimately hosts a DialogPropertyValueEditor.
// Both PropertyInspector control as well as PropertyValueDialogControl use this class.
// </summary>
Expand Down Expand Up @@ -71,7 +71,7 @@ public void OnCanOpenDialogWindow(object sender, CanExecuteRoutedEventArgs e)

// <summary>
// Called in response to OpenDialogWindow command firing. The method opens a
// [....] Form that contains an ElementHost that, in turn, contains
// Microsoft Form that contains an ElementHost that, in turn, contains
// PropertyValueDialogControl.
// </summary>
// <param name="sender"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal static class VisualTreeUtils
private const int MaxSearchDepth = 5;

// The maxium wpf visual tree depth
// this value should be kept in [....] with WPF's limit
// this value should be kept in sync with WPF's limit
private const int MaxAllowedTreeDepth = 250;

// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static object OnCoerceEditModeProperty(DependencyObject obj, object valu

EditModeSwitchButton theThis = (EditModeSwitchButton) obj;

// [....] to the owning PropertyContainer only if requested to do so
// Sync to the owning PropertyContainer only if requested to do so
if (!theThis.SyncModeToOwningContainer)
return value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void HookupMessageProcessing()
{
this.hwndSource = HwndSource.FromHwnd(this.ParentWindowHwnd);
}
//if didn't succeed - (either handle is null or we are hosted in [....] app)
//if didn't succeed - (either handle is null or we are hosted in Microsoft app)
//try to create hwnd source out of designer's view
if (null == this.hwndSource)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ private void AddCore(ModelItem key, ModelItem value, bool updateInstance)

if (updateInstance)
{
//no need to [....] if the ItemsCollection is not DictionaryItemsCollection wrapped by ModelItemCollectionImpl
//no need to sync if the ItemsCollection is not DictionaryItemsCollection wrapped by ModelItemCollectionImpl
ModelItemCollectionImpl itemsCollectionImpl = this.ItemsCollectionModelItemCollection as ModelItemCollectionImpl;
if (ItemsCollectionObject != null && itemsCollectionImpl != null)
{
Expand Down Expand Up @@ -810,7 +810,7 @@ private void ClearCore(bool updateInstance)
IList removed = this.modelItems.ToList<KeyValuePair<ModelItem, ModelItem>>();
if (updateInstance)
{
//no need to [....] if the ItemsCollection is not DictionaryItemsCollection wrapped by ModelItemCollectionImpl
//no need to sync if the ItemsCollection is not DictionaryItemsCollection wrapped by ModelItemCollectionImpl
ModelItemCollectionImpl itemsCollectionImpl = this.ItemsCollectionModelItemCollection as ModelItemCollectionImpl;
if (ItemsCollectionObject != null && itemsCollectionImpl != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace System.Activities.Presentation.Model

// This class provides the implementation for a model property.
// this intercepts sets /gets to the property and works with modeltreemanager
// to keep the xaml in [....].
// to keep the xaml in sync.

class ModelPropertyImpl : ModelProperty
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public bool ExplicitCommit
set { SetValue(ExplicitCommitProperty, value); }
}

//[....]
//Microsoft
public IExpressionEditorService ExpressionEditorService
{
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ void SetVariableType(Type type)
{
variable.Default = morphedExpression;
}
//[....]
//Microsoft

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void SetLineInfo(int lineNumber, int linePosition)
this.lineNumber = lineNumber;
this.linePosition = linePosition;

// But we also need to keep it in [....] with the nodestream, for XOW errors
// But we also need to keep it in sync with the nodestream, for XOW errors
// XOW and XamlNodeQueue.Writer both implement IXamlLineInfoConsumer, so we can do a straight cast
if (this.rootFragment.HasError)
{
Expand Down
5 changes: 2 additions & 3 deletions System.Activities/System/Activities/Debugger/StateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public sealed class StateManager : IDisposable

static Type threadWorkerControllerType = typeof(ThreadWorkerController);
static MethodInfo islandWorkerMethodInfo = threadWorkerControllerType.GetMethod("IslandWorker", BindingFlags.Static | BindingFlags.Public);
const string Md5Identifier = "406ea660-64cf-4c82-b6f0-42d48172a799";
internal const string MethodWithPrimingPrefix = "_";

List<LogicalThread> threads;
Expand Down Expand Up @@ -681,7 +680,7 @@ MethodBuilder CreateIsland(TypeBuilder typeBuilder, State state, bool withPrimin
[SecurityCritical]
void InitDynamicModule(string asmName)
{
// See http://blogs.msdn.com/[....]/archive/2005/02/03/366429.aspx for a simple example
// See http://blogs.msdn.com/Microsoft/archive/2005/02/03/366429.aspx for a simple example
// of debuggable reflection-emit.
Fx.Assert(dynamicModule == null, "can only be initialized once");

Expand Down Expand Up @@ -791,7 +790,7 @@ private ISymbolDocumentWriter GetSourceDocument(string fileName, byte[] checksum

if (checksumBytes != null)
{
documentWriter.SetCheckSum(new Guid(Md5Identifier), checksumBytes);
documentWriter.SetCheckSum(SymbolHelper.ChecksumProviderId, checksumBytes);
}
}
return documentWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ namespace System.Activities.Debugger.Symbol

internal static class SymbolHelper
{
static readonly Guid Md5IdentifierGuid = new Guid("406ea660-64cf-4c82-b6f0-42d48172a799");
static readonly Guid Sha1IdentifierGuid = new Guid("ff1816ec-aa5e-4d10-87f7-6f4963833460");

public static Guid ChecksumProviderId
{
get
{
if (LocalAppContextSwitches.UseMD5ForWFDebugger)
{
return Md5IdentifierGuid;
}
else
{
return Sha1IdentifierGuid;
}
}
}

// This is the same Encode/Decode logic as the WCF FramingEncoder
public static int ReadEncodedInt32(BinaryReader reader)
{
Expand Down Expand Up @@ -61,8 +79,6 @@ public static int GetEncodedSize(int value)
return count;
}

[SuppressMessage("Microsoft.Cryptographic.Standard", "CA5350:MD5CannotBeUsed",
Justification = "Design has been approved. We are not using MD5 for any security or cryptography purposes but rather as a hash.")]
public static byte[] CalculateChecksum(string fileName)
{
Fx.Assert(!string.IsNullOrEmpty(fileName), "fileName should not be empty or null");
Expand All @@ -71,8 +87,10 @@ public static byte[] CalculateChecksum(string fileName)
{
using (StreamReader streamReader = new StreamReader(fileName))
{
MD5 md5 = new MD5CryptoServiceProvider();
checksum = md5.ComputeHash(streamReader.BaseStream);
using (HashAlgorithm hashAlgorithm = CreateHashProvider())
{
checksum = hashAlgorithm.ComputeHash(streamReader.BaseStream);
}
}
}
catch (IOException)
Expand Down Expand Up @@ -108,7 +126,28 @@ public static string GetHexStringFromChecksum(byte[] checksum)
internal static bool ValidateChecksum(byte[] checksumToValidate)
{
// We are using MD5.ComputeHash, which will return a 16 byte array.
return checksumToValidate.Length == 16;
if (LocalAppContextSwitches.UseMD5ForWFDebugger)
{
return checksumToValidate.Length == 16;
}
else
{
return checksumToValidate.Length == 20;
}
}

[SuppressMessage("Microsoft.Cryptographic.Standard", "CA5350:MD5CannotBeUsed",
Justification = "Design has been approved. We are not using MD5 for any security or cryptography purposes but rather as a hash.")]
static HashAlgorithm CreateHashProvider()
{
if (LocalAppContextSwitches.UseMD5ForWFDebugger)
{
return new MD5CryptoServiceProvider();
}
else
{
return new SHA1CryptoServiceProvider();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ internal Scheduler.RequestedAction OnExecuteWorkItem(WorkItem workItem)
return Scheduler.Continue;
}

// We only check this in the [....] path because there are no ways of changing the keys collections from the work items that can
// We only check this in the sync path because there are no ways of changing the keys collections from the work items that can
// go async. There's an assert to this effect in FinishWorkItem.
if (this.bookmarkScopeManager != null && this.bookmarkScopeManager.HasKeysToUpdate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ public void LoadActivityTree(Activity rootActivity, ActivityInstance rootInstanc
}

// We need to null this out once we've recreated the dictionary to avoid
// having out of [....] data
// having out of sync data
this.rawDeserializedLists = null;

// then walk our instance list, fixup parent references, and perform basic validation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ public IAsyncResult BeginExecuteMethod(AsyncCodeActivityContext context, AsyncCa
}
}

return BeginMakeMethodCall(context, targetInstance, callback, state); // defer to concrete instance for [....]/async variations
return BeginMakeMethodCall(context, targetInstance, callback, state); // defer to concrete instance for sync/async variations
}

public void EndExecuteMethod(AsyncCodeActivityContext context, IAsyncResult result)
{
EndMakeMethodCall(context, result); // defer to concrete instance for [....]/async variations
EndMakeMethodCall(context, result); // defer to concrete instance for sync/async variations
}

[SuppressMessage("Reliability", "Reliability108:IsFatalRule",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ MethodInfo Resolve(Type targetType, string methodName, BindingFlags bindingFlags
{
return null;
}
else // For a regular [....] method, ambiguity is distinct from no match and gets an explicit error message
else // For a regular sync method, ambiguity is distinct from no match and gets an explicit error message
{
throw;
}
Expand Down
6 changes: 3 additions & 3 deletions System.Activities/System/Activities/WorkflowApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ static void EventFrame(IAsyncResult result)

try
{
// The "false" is to notify that we are not still [....]
// The "false" is to notify that we are not still sync
done = data.NextCallback(result, thisPtr, false);
}
catch (Exception e)
Expand Down Expand Up @@ -1100,7 +1100,7 @@ public void EndTerminate(IAsyncResult result)
TerminateAsyncResult.End(result);
}

// called from the [....] and async paths
// called from the sync and async paths
void CancelCore()
{
// We only actually do any work if we haven't completed and we aren't
Expand Down Expand Up @@ -3867,7 +3867,7 @@ bool DeleteOwner()
if (this.instance.HasPersistenceProvider && this.instance.persistenceManager.OwnerWasCreated &&
(this.operation == PersistenceOperation.Unload || this.operation == PersistenceOperation.Complete))
{
// This call uses the ambient transaction directly if there was one, to mimic the [....] case.
// This call uses the ambient transaction directly if there was one, to mimic the sync case.
//
IAsyncResult deleteOwnerResult = null;
using (PrepareTransactionalCall(this.dependentTransaction))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public bool TryBeginComplete(AsyncCallback callback, object state, out IAsyncRes
{
// In the interest of allocating less objects we don't implement
// the full async pattern here. Instead, we've flattened it to
// do the [....] part and then optionally delegate down to the inner
// do the sync part and then optionally delegate down to the inner
// BeginCommit.

if (this.contextOwnedTransaction != null)
Expand Down
Loading

0 comments on commit 4251daa

Please sign in to comment.